Project 5 : programming ArcObject with VBA Part I Vector data Sherry Fu CE 697V Nov. 30, 2006.

Slides:



Advertisements
Similar presentations
Geographic Information Systems Using ESRI ArcGIS 9.3 Join and Relate Tables.
Advertisements

Concepts of Maintaining Your Data Simple Ways to Edit Your Data By Lorne Woods.
Intro to ArcGIS for New Users. ArcGIS Desktop Advanced GeoprocessingArcInfo ArcReader Data Access Map Viewing Query Advanced EditingArcEditor ArcView.
NSF DUE ; Laura Johnson Wen Andrews.
AFOPro Spatial AFOPro Spatial is an extension created for ArcView 3.x. Before using the Tool the user must prepare some spatial data in ArcView. Add existing.
Access Tutorial 1 Creating a Database
Object-Based Vector Data Model
19 th Advanced Summer School in Regional Science Overview and more advanced directions with ArcGIS.
Chapter Extension 6 Using Microsoft Access © 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke.
ESRM 250 & CFR 520: Introduction to GIS © Phil Hurvitz, KEEP THIS TEXT BOX this slide includes some ESRI fonts. when you save this presentation,
Querying an Avian Inventory Database and Visualizing the Results GEORGE WASHINGTON BIRTHPLACE NATIONAL MONUMENT NATIONAL PARK SERVICE NR 595D Final Project.
Editing Basics (in ArcGIS 9.2) By Alma Vargas. Levels of Desktop ArcGIS Arc View Version that most clients will use The version that this session will.
Introduction to ArcGIS for Environmental Scientists Module 2 – Fundamentals Lecture 6 – Table Functions.
Welcome to Mapping Tom Sellsted – City of Yakima, Washington Vladimir Strinski – Hitech Systems.
Selecting and Displaying Features. Why do you need to select features? Why do you need to select features? Selection methods Selection methods Select.
Adv_GISArcObjects - 11 VBA and ArcObjects Fall 2003 Advanced GIS.
A New Generation GIS for the Classroom ArcGIS 9.0 A New Generation GIS for the Classroom.
The Attribute Table! Without the attribute table, a polygon is just a polygon, a point is a point The attribute table defines what points, lines, or polygons.
Matching school attendance boundaries with schools from CCD dataset.
Adv_GISArcObjects - 11 VBA and ArcObjects Programming Week 1 Spring 2008 Advanced GIS.
Threats Database V4 Model Geodatabase Relation Class Creation and Data Population June 25, 2007 Marlene McKinnon, GIS Specialist.
MS Access Tour Sesión # 6. MS Access Tour Database Management System (DBMS): An application software that allows users to create, manipulate, and change.
Using Describe. Topics How to use describe? Retrieving Descriptive Information about data.
Introduction to ArcGIS for Environmental Scientists Module 2 – Fundamentals Chapter 7 – Queries.
Exercise 1: Creating GIS data—points lines and polygons A very common method of creating vector data is to physically create these files through on-screen.
Automatic Turntable Calculation Tool Melissa J Rura CE 508 Dr. Shan 10/29/2004.
Getting Information OUT of MainSaver The Truth is out there!!! Last Modified: September 23, 2003 Creator: Phillip D. Hicks.
Intro to GIS and ESRI Trainers: Randy Jones, GIS Technician, Douglas County Jon Fiskness, GISP GIS Coordinator, City of Superior.
ATN GIS Support ArcGIS: ArcMap Data View.
Chapter 12 Making Tools Week 7 Fall Tools (events) besides Click MouseDown, MouseUp, MouseMove CursorID defines mouse appearance Eabled to disable.
Innovation Intelligence ® Section 1 User Interface and Layout.
Key Applications Module Lesson 21 — Access Essentials
Access Manual 2 By Dhawala Kovuri Elham S.Khorasani Ismail Guneydas.
Data Queries Selecting features in ArcMap Data queries  Important part of a GIS project Can be a part of your data preparation or final analysis  Data.
Adding shapefiles as feature layers Adding coverages as feature layers Adding grids as raster layers Adding tables as table windows Adding text files as.
® Microsoft Office 2013 Access Creating a Database.
Arch: 383 Introduction to GIS Week 2 Introduction to GEOGRAPHIC INFORMATION SYSTEMS Can Kara Faculty of Architecture 2011 ARC 383.
Queries Select by Attribute Select by Location. What is a Query? A query extracts information from a data table for further use –Once extracted you can:
ADV_GISVB - IV1 Advanced GIS Objects/Interfaces Week Spring.
Microsoft FrontPage 2003 Illustrated Complete Integrating a Database with a Web Site.
As we upgrade from ImageNow 6.1 to ImageNow 6.3, there are some changes to the interface that the end-users will see. These slides cover changes to the.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
Juanita Cano City of Sacramento Spring 2014 Geography 375.
Chapter 11 Navigating Object Model Diagrams Week 6, 2008 Spring.
Selecting features in ArcMap
Towards Unifying Vector and Raster Data Models for Hybrid Spatial Regions Philip Dougherty.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
Create A Shapefile From data files By Mrinmoy Majumder
Programming for Geographical Information Analysis: Advanced Skills Lecture 3: Arc Data Framework Dr Andy Evans.
Form and Graphical User Interfaces. Lesson plan More about queries More about entering data into a table Form.
Objective – Students will be able to investigate graphs with different viewing windows or viewing screens. Therefore learning how important it is to choose.
Chapter 3: I Need a Tour Guide (Introduction to Visual Basic 2012)
Key Terms Attribute join Target table Join table Spatial join.
A Look at Creating & Updating Point Files
VB 2010 Pertemuan 10.
Pixel Editor PX 1.0 Ajay Prasad.
Cameron Blashka| Informer Implementation Specialist
WOCAT Mapping methodology
Demo #5: creating a point shapefile from Excel tables
Development of Linear Measure Tool using Application Framework
Preliminaries: -- vector, raster, shapefiles, feature classes.
Symbolizing elements and layers(I)
Lecture 4 An example for changing a layer’s Name
Using VB Active-X components to customize a new tool on ArcMap
Working Spatial Data File Geodatabase
Lecture 05 Organizing Geographic Data
Making a reclassification table
Electronic Field Study Advanced User Training
Solving a System of Linear and Quadratic Equations Algebraically
Presentation transcript:

Project 5 : programming ArcObject with VBA Part I Vector data Sherry Fu CE 697V Nov. 30, 2006

Part I Project Part I – Vector data Move an assigned polygon right border 25 unit to the right.

Prepare an Add Data dialog Dim pGxDialog As IGxDialog Dim pGxFilter As IGxObjectFilter Set pGxDialog = New GxDialog Set pGxFilter = New GxFilterShapefiles ' Define the dialog's properties. With pGxDialog.AllowMultiSelect = True.ButtonCaption = "Add" Set.ObjectFilter = pGxFilter.Title = "Add Shapefiles" End With Let the users select shapefiles from a dialog box and adds them to an active map. The key point is to use ArcCatalog classes: GxDialog and GxFilter. GxDialog is a form to accept the datasets selected by the user and add them.

Get the datasets This part is to get the datasets selected by the user and adds them as layers to the map. The DoModalOpen method open the dialog box and saves the selected files into a collection. pGxDialog.DoModalOpen 0, pGxObjects Set pGxDataset = pGxObjects.Next ' Exit sub if no dataset has been added. If pGxDataset Is Nothing Then Exit Sub End If Do Until pGxDataset Is Nothing Set pLayer = New FeatureLayer Set pLayer.FeatureClass = pGxDataset.Dataset pLayer.Name = pLayer.FeatureClass.AliasName pMap.AddLayer pLayer Set pGxDataset = pGxObjects.Next Loop

Query select feature The third polygon ID is To search the feature on the layer. Use pQueryFilter.WhereClause SQL to select the assigned ID from attribute table field of the shapefile and export the filtered data. Dim pMXDoc As IMxDocument Set pMXDoc = ThisDocument Dim pLayer As IFeatureLayer Set pLayer = pMXDoc.FocusMap.Layer(0) Dim pFeatureSelection As IFeatureSelection Set pFeatureSelection = pLayer Dim pQueryFilter As IQueryFilter Set pQueryFilter = New QueryFilter pQueryFilter.WhereClause = "PolyID=100103"

Perform the selection Perform the select feature by pQueryFilter and flag the selection by pActiveView.PartialRefresh esriViewGeoSelection The selected feature will be active on the map. pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing pFeatureSelection.SelectFeatures pQueryFilter, esriSelectionResultNew, False pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing Dim pFeatureCursor As IFeatureCursor Dim pFeature As IFeature Dim pGeometry As IGeometry Dim pPolygon As IPolygon Set pFeatureCursor = pLayer.Search(pQueryFilter, False) Set pFeature = pFeatureCursor.NextFeature Set pPolygon = pFeature.Shape

Deal with the selected feature The selected feature is a rectangle. Therefore, we can apply IEnvelope interface. Envelopes are the rectangular window that contain a specific element. The envelope is an geometry objects defined by the XMin, XMax, YMin, and YMax of the object Dim pEnvelopeFrom As IEnvelope, Dim pEnvelopeTo As IEnvelope Set pEnvelopeFrom=pFeature.Extent Dim pPolColl As IGeometryCollection Set pPolColl = pPolygon Dim pPtColl As IPointCollection Set pPtColl = pPolygon Dim pPoint As IPoint

Move two points of selected feature Move the feature right border 25 unit to the right. To access and manipulate point geometry by using IGeometryCollection and IPointCollection. The method is to move XMax and XMin points by +25. Set pPoint = New Point pPoint.X = pEnvelopeFrom.XMax + 25 pPoint.Y = pEnvelopeFrom.YMax pPtColl.UpdatePoint 1, pPoint pPolColl.GeometriesChanged pFeature.Store Set pPoint = New Point pPoint.X = pEnvelopeFrom.XMax + 25 pPoint.Y = pEnvelopeFrom.YMin pPtColl.UpdatePoint 2, pPoint pPolColl.GeometriesChanged pFeature.Store