Samples

Clip_Shapefile_By_Envelope

Description:

This sample purpose is to show pure ArcGIS Engine developers how to accomplish basic geoprocessing tasks using ITopologicalOperator. Applications like this are suitable for batch driven processing. The application takes a source shapefile and the extents of a clipping envelope. These are used to export the features inside the clipping envelope to a newly created shapefile.
Products:

Engine: C++, Java

Platforms: Windows, Solaris, Linux

Minimum ArcGIS Release: 9.0

How to use:
  1. Run the application.
  2. A new shapefile of the clip will be created.
[C++]

C++ Specific Notes

  1. Run the application with valid data for the following parameters:
    • input shapefile
    • outut shapefile
  2. Parameters for the envelope have been hardcoded. To use a different envelope, edit the following lines from the top of ClipShapefileByEnv.cpp:

      double xMin = -130.0;

      double xMax = -114.0;

      double yMin = 31.0;

      double yMax = 41.5;

[Java]

Java Specific Notes

  1. In the sample.properties file, uncomment the following arguments and add locations local to your system:
    • input.data.path : Path to input shapefile
    • output.data.path : Path to resulting shapefile
    • xmin : xmin value for clip envelope
    • ymin : ymin value for clip envelope
    • xmax : xmax value for clip envelope
    • ymax : ymax value for clip envelope

C++ Java
File Description
ClipShapefileByEnv.h Header File
ClipShapefileByEnv.cpp Implementation File
LicenseUtilities.h Licensing Header File
LicenseUtilities.cpp Licensing Implementation File
PathUtilities.h Path Parsing Header File
PathUtilities.cpp Path Parsing Implementation File
Makefile.Windows Windows Makefile
Makefile.Solaris Solaris Makefile
Makefile.Linux Linux Makefile
vs6.dsw Visual Studio 6.0 project workspace file
vs6.dsp Visual Studio 6.0 project file
vs7.sln Visual Studio .NET 2003 project workspace file
vs7.vcproj Visual Studio .NET 2003 project file


Key Libraries: geodatabase, geometry
Key CoClasses:Envelope, ShapefileWorkspaceFactory, SpatialFilter
Key Interfaces: IFeature, IFeatureBuffer, IFeatureClass, IFeatureCursor, IFeatureWorkspace, IGeometry, ITopologicalOperator
Key Members:IFeatureWorkspace::CreateFeatureClass


Feedback Send feedback on this sample