Create a shapefile from a text file with XY values


Purpose
This sample demonstrates how to create a points shapefile from a text file that contains latitude, longitude, and value pairs. The text file contains one pair per line, and each latitude, longitude, and value data item is separated by white space (for example, tab delimited).

How to use

See How to use ArcGIS samples for help on running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Run the application. Since this is a command-line application, you can use Ant to run it, you can execute its Java Archive (JAR) file from the command line, or you can use your integrated development environment (IDE) to compile and run it. As with all other samples, it requires no arguments to run.
  2. This application prints each point feature's location and the value of the value field that was created and stored for each one.


Download the files for Java
geodatabase/CreateShapefile.java Main class




Additional Requirements
  • A text file with each point on a separate line and tab-delimited values for the longitude, latitude, and value of each point.

Development licensing Deployment licensing
Engine Developer Kit Engine Runtime
ArcView