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"

(New page: Test)
 
(The Esri Shapefile Format)
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Test
+
== The Esri Shapefile Format ==
 +
 
 +
The Esri shapefile is a popular format for geographic information systems (GIS). Shapefiles can describe polygons, polylines and points. For example, polygons can represent geographical regions like countries and states while polylines can represent roads, rivers and so on. Points are currently not 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.
 +
 
 +
* <tt>.shp</tt> &mdash; shape format; contains the shapes (polygons, polylines and points)
 +
* <tt>.prj</tt> &mdash; projection format; contains the coordinate system and projection information
 +
* <tt>.dbf</tt> &mdash; 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 UI for importing shapefiles can be displayed by choosing the item '''Shapefile Graph Generator''' in the '''New Graph''' wizard. Click on '''Select Shape Files''' to select multiple shapefiles in a file dialog. For each of the shapefiles, you must specify if the file contains regions, roads or polylines with migration data. Also you need to specify a unique ID for each shape by selecting an ID column in the related combo box. The data of all columns can be displayed by clicking on '''Show Data'''.
 +
For region shapefiles additional parameters can be specified (optional). These parameters are the '''Region Area''', '''Area Unit''' (all areas are converted to km^2) and any number of populations (specified by '''Population Name''' and '''Population Size''').
 +
If the shapefile contains roads or polylines with migration data, the following additional parameters must be specified: '''Road Class''' / '''Migration Population''', '''Migration Rate'''. To do so, either use the data from a table column or enter the value for the parameter in the text field. In the latter case,  the same value is used for all shapes.
 +
 
 +
== Example 1 ==
 +
 
 +
The shapefile used in this example can be downloaded from [http://sg.geodatenzentrum.de/web_download/vg/vg250-ew_3112/utm32s/shape/vg250-ew_3112.utm32s.shape.ebenen.zip].
 +
First the file '''vg250_bld.shp''' is loaded by clicking '''Select Shapefiles'''.
 +
The type is set to '''Regions''', '''RS''' is used as Region ID, '''SHAPE_AREA''' as Region Area, '''m^2''' as Area Unit.
 +
Then '''Add Population''' is clicked, Population Name is set to '''human''' and '''EWZ''' is used as Population Size.
 +
 
 +
[[Image:ShapefileImporterRegions1.png|400px]]
 +
 
 +
Running the Shapefile Graph Generator as shown above, the result should look like this in the Graph Editor.
 +
 
 +
[[Image:ShapefileImporterResult1.png|400px]]
 +
 
 +
== Example 2 ==
 +
 
 +
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 files '''PolbndA.shp''' and '''RailrdL.shp''' are loaded by clicking '''Select Shapefiles'''.
 +
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="500px" heights="500px">
 +
Image:ShapefileImporterRegions.png | Configure Region Shapefile
 +
Image:ShapefileImporterRoads.png | Configure Road Shapefile
 +
</gallery>
 +
 
 +
Running the Shapefile Graph Generator as shown above, the result should look like this in the Graph Editor.
 +
 
 +
[[Image:ShapefileImporterResult.png|400px]]

Latest revision as of 09:48, 30 May 2013

The Esri Shapefile Format

The Esri shapefile is a popular format for geographic information systems (GIS). Shapefiles can describe polygons, polylines and points. For example, polygons can represent geographical regions like countries and states while polylines can represent roads, rivers and so on. Points are currently not 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 UI for importing shapefiles can be displayed by choosing the item Shapefile Graph Generator in the New Graph wizard. Click on Select Shape Files to select multiple shapefiles in a file dialog. For each of the shapefiles, you must specify if the file contains regions, roads or polylines with migration data. Also you need to specify a unique ID for each shape by selecting an ID column in the related combo box. The data of all columns can be displayed by clicking on Show Data. For region shapefiles additional parameters can be specified (optional). These parameters are the Region Area, Area Unit (all areas are converted to km^2) and any number of populations (specified by Population Name and Population Size). If the shapefile contains roads or polylines with migration data, the following additional parameters must be specified: Road Class / Migration Population, Migration Rate. To do so, either use the data from a table column or enter the value for the parameter in the text field. In the latter case, the same value is used for all shapes.

Example 1

The shapefile used in this example can be downloaded from [1]. First the file vg250_bld.shp is loaded by clicking Select Shapefiles. The type is set to Regions, RS is used as Region ID, SHAPE_AREA as Region Area, m^2 as Area Unit. Then Add Population is clicked, Population Name is set to human and EWZ is used as Population Size.

ShapefileImporterRegions1.png

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

ShapefileImporterResult1.png

Example 2

The shapefiles used in this example can be downloaded from [2]. The files PolbndA.shp and RailrdL.shp are loaded by clicking Select Shapefiles. 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