Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Importing an Esri Shapefile"

(Using the Shapefile Importer)
Line 1: Line 1:
 
== The Esri Shapefile Format ==
 
== The Esri Shapefile Format ==
  
The Esri shapefile is a popular format for geographic information systems (GIS). Shapefiles can describe polygons, polylines and points. Polygons can, for example, represent geographical regions like countries and states while polylines can represent roads, rivers and so on. Points are currently not used used in the shapefile importer.
+
The Esri shapefile is a popular format for geographic information systems (GIS). Shapefiles can describe polygons, polylines and points. Polygons can, for example, represent geographical regions like countries and states while polylines can represent roads, rivers and so on. Points are currently not used used in the Shapefile Graph Generator.
  
A shapefile is a set of various files, three of these files are used by the shapefile importer.
+
A shapefile is a set of various files, three of these files are used by the Shapefile Graph Generator .
  
 
* <tt>.shp</tt> &mdash; shape format; contains the shapes (polygons, polylines and points)
 
* <tt>.shp</tt> &mdash; shape format; contains the shapes (polygons, polylines and points)
Line 9: Line 9:
 
* <tt>.dbf</tt> &mdash; attribute format; contains attributes for each shape
 
* <tt>.dbf</tt> &mdash; attribute format; contains attributes for each shape
  
== Using the Shapefile Importer ==
+
== Using the Shapefile Graph Generator ==
 +
 
 +
The Shapefile Graph Generator can read polygons and polylines from shapefiles. Polygons are imported as geographical regions while polylines can be processed to create different kinds of edges. If a shapefile contains a road network, the polylines could be used to create Road Transportation Edges.
 +
 
 +
The shapefiles used in this example can be downloaded from [http://www.eurogeographics.org/sites/default/files/imported-files/documents/EGM_shape_sample.zip]. The UI for importing shapefiles can be displayed by choosing the item '''Shapefile Graph Generator''' in the '''New Graph''' wizard. When clicking on '''Select Shape Files''' multiple shapefiles can be selected in a file dialog. For each of the shapefiles it must be specified if the file contains regions, roads or polylines with migration data. Additionally an unique ID for each shape has to be specified by selecting an ID column in the related combo box. If the shapefile contains roads or polylines with migration data additional parameters like '''Road Class''', '''Migration Rate''' and so on must be specified. To do so the data from a table column can be used or the value for the parameter can be entered in the text field. In the latter case the same value is used for all shapes.
 +
 
 +
On the images below one can see an example on how to use the GUI. First '''PolbndA.shp''' is selected, the type is set to '''Regions''' and '''gfid''' is used as Region ID. Then '''RailrdL.shp''' is selected, the type is set to '''Roads''', '''gfid''' is used as Road ID and the Road Class is set to '''Railroad'''.
  
 
<gallery widths="450px" heights="450px">
 
<gallery widths="450px" heights="450px">
Line 16: Line 22:
 
</gallery>
 
</gallery>
  
Running the Shapefile Importer as shown above, the result should look like this in the Graph Editor.
+
Running the Shapefile Graph Generator as shown above, the result should look like this in the Graph Editor.
  
 
[[Image:ShapefileImporterResult.png|400px]]
 
[[Image:ShapefileImporterResult.png|400px]]

Revision as of 10:33, 7 March 2012

The Esri Shapefile Format

The Esri shapefile is a popular format for geographic information systems (GIS). Shapefiles can describe polygons, polylines and points. Polygons can, for example, represent geographical regions like countries and states while polylines can represent roads, rivers and so on. Points are currently not used used in the Shapefile Graph Generator.

A shapefile is a set of various files, three of these files are used by the Shapefile Graph Generator .

  • .shp — shape format; contains the shapes (polygons, polylines and points)
  • .prj — projection format; contains the coordinate system and projection information
  • .dbf — attribute format; contains attributes for each shape

Using the Shapefile Graph Generator

The Shapefile Graph Generator can read polygons and polylines from shapefiles. Polygons are imported as geographical regions while polylines can be processed to create different kinds of edges. If a shapefile contains a road network, the polylines could be used to create Road Transportation Edges.

The shapefiles used in this example can be downloaded from [1]. The UI for importing shapefiles can be displayed by choosing the item Shapefile Graph Generator in the New Graph wizard. When clicking on Select Shape Files multiple shapefiles can be selected in a file dialog. For each of the shapefiles it must be specified if the file contains regions, roads or polylines with migration data. Additionally an unique ID for each shape has to be specified by selecting an ID column in the related combo box. If the shapefile contains roads or polylines with migration data additional parameters like Road Class, Migration Rate and so on must be specified. To do so the data from a table column can be used or the value for the parameter can be entered in the text field. In the latter case the same value is used for all shapes.

On the images below one can see an example on how to use the GUI. First PolbndA.shp is selected, the type is set to Regions and gfid is used as Region ID. Then RailrdL.shp is selected, the type is set to Roads, gfid is used as Road ID and the Road Class is set to Railroad.

Running the Shapefile Graph Generator as shown above, the result should look like this in the Graph Editor.

ShapefileImporterResult.png

Back to the top