Skip to main content
deleted 31 characters in body
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

First, welcome to the site!

The easiest way would be to use ogr2ogr from the GDAL package (an open source spatial conversions library) and convert your feature class to a text format such as GeoJSON (and the specification). I'd strongly recommend this method if possible, especially if you don't have much programming experience.

If you don't have access to this (can't install it, or your data is in SDE or another format which you can't access with ogr2ogr) then it's possible using the arcpy Python module to extract feature geometries using a SearchCursor (I'm assuming you're using ArcGIS 10, but this would also work with 10.1).

Depending on your polygons you have two potential methods in ArcGIS:

  • If you have simple polygons (no multipart, no holes) you can use geom.geo_interface to extract the vertices as a geojson string. For example:
shapefieldname = arcpy.Describe(dataset).ShapeFieldName

for row in arcpy.SearchCursor(dataset):
    print row.getValue(shapefieldname).__geo_interface__
  • Otherwise if the geometry is more complex take a look at this sample script from the ESRI help on Reading Geometries.

First, welcome to the site!

The easiest way would be to use ogr2ogr from the GDAL package (an open source spatial conversions library) and convert your feature class to a text format such as GeoJSON (and the specification). I'd strongly recommend this method if possible, especially if you don't have much programming experience.

If you don't have access to this (can't install it, or your data is in SDE or another format which you can't access with ogr2ogr) then it's possible using the arcpy Python module to extract feature geometries using a SearchCursor (I'm assuming you're using ArcGIS 10, but this would also work with 10.1).

Depending on your polygons you have two potential methods in ArcGIS:

  • If you have simple polygons (no multipart, no holes) you can use geom.geo_interface to extract the vertices as a geojson string. For example:
shapefieldname = arcpy.Describe(dataset).ShapeFieldName

for row in arcpy.SearchCursor(dataset):
    print row.getValue(shapefieldname).__geo_interface__
  • Otherwise if the geometry is more complex take a look at this sample script from the ESRI help on Reading Geometries.

The easiest way would be to use ogr2ogr from the GDAL package (an open source spatial conversions library) and convert your feature class to a text format such as GeoJSON (and the specification). I'd strongly recommend this method if possible, especially if you don't have much programming experience.

If you don't have access to this (can't install it, or your data is in SDE or another format which you can't access with ogr2ogr) then it's possible using the arcpy Python module to extract feature geometries using a SearchCursor (I'm assuming you're using ArcGIS 10, but this would also work with 10.1).

Depending on your polygons you have two potential methods in ArcGIS:

  • If you have simple polygons (no multipart, no holes) you can use geom.geo_interface to extract the vertices as a geojson string. For example:
shapefieldname = arcpy.Describe(dataset).ShapeFieldName

for row in arcpy.SearchCursor(dataset):
    print row.getValue(shapefieldname).__geo_interface__
  • Otherwise if the geometry is more complex take a look at this sample script from the ESRI help on Reading Geometries.
added 1 characters in body
Source Link
Chad Cooper
  • 12.7k
  • 4
  • 47
  • 87

First, welcome to the site!

The easiest way would be to use ogr2ogr from the GDAL package (an open source spatial conversions library) and convert your feature class to a text format such as GeoJSON (and the specification). I'd strongly recommend this method if possible, especially if you don't have much programming experience.

If you don't have access to this (can't install it, or your data is in SDE or another format which you can't access with ogr2ogr) then it's possible using the arcpy Python module to extract feature geometries using a SearchCursor (I'm assuming you're using ArcGIS 10, but this would also work with 10.1).

Depending on your polygons you have two potential methods in ArcGIS:

  • If you have simple polygons (no multipart, no holes) you can use geom.geo_interface to extract the vertices as a geojson string. For example:
shapefieldname = arcpy.Describe(dataset).ShapeFieldName

for row in arcpy.SearchCursor(dataset):
    print row.getValue(shapefieldname).__geo_inerface____geo_interface__
  • Otherwise if the geometry is more complex take a look at this sample script from the ESRI help on Reading Geometries.

First, welcome to the site!

The easiest way would be to use ogr2ogr from the GDAL package (an open source spatial conversions library) and convert your feature class to a text format such as GeoJSON (and the specification). I'd strongly recommend this method if possible, especially if you don't have much programming experience.

If you don't have access to this (can't install it, or your data is in SDE or another format which you can't access with ogr2ogr) then it's possible using the arcpy Python module to extract feature geometries using a SearchCursor (I'm assuming you're using ArcGIS 10, but this would also work with 10.1).

Depending on your polygons you have two potential methods in ArcGIS:

  • If you have simple polygons (no multipart, no holes) you can use geom.geo_interface to extract the vertices as a geojson string. For example:
shapefieldname = arcpy.Describe(dataset).ShapeFieldName

for row in arcpy.SearchCursor(dataset):
    print row.getValue(shapefieldname).__geo_inerface__
  • Otherwise if the geometry is more complex take a look at this sample script from the ESRI help on Reading Geometries.

First, welcome to the site!

The easiest way would be to use ogr2ogr from the GDAL package (an open source spatial conversions library) and convert your feature class to a text format such as GeoJSON (and the specification). I'd strongly recommend this method if possible, especially if you don't have much programming experience.

If you don't have access to this (can't install it, or your data is in SDE or another format which you can't access with ogr2ogr) then it's possible using the arcpy Python module to extract feature geometries using a SearchCursor (I'm assuming you're using ArcGIS 10, but this would also work with 10.1).

Depending on your polygons you have two potential methods in ArcGIS:

  • If you have simple polygons (no multipart, no holes) you can use geom.geo_interface to extract the vertices as a geojson string. For example:
shapefieldname = arcpy.Describe(dataset).ShapeFieldName

for row in arcpy.SearchCursor(dataset):
    print row.getValue(shapefieldname).__geo_interface__
  • Otherwise if the geometry is more complex take a look at this sample script from the ESRI help on Reading Geometries.
Source Link
om_henners
  • 15.7k
  • 2
  • 47
  • 86

First, welcome to the site!

The easiest way would be to use ogr2ogr from the GDAL package (an open source spatial conversions library) and convert your feature class to a text format such as GeoJSON (and the specification). I'd strongly recommend this method if possible, especially if you don't have much programming experience.

If you don't have access to this (can't install it, or your data is in SDE or another format which you can't access with ogr2ogr) then it's possible using the arcpy Python module to extract feature geometries using a SearchCursor (I'm assuming you're using ArcGIS 10, but this would also work with 10.1).

Depending on your polygons you have two potential methods in ArcGIS:

  • If you have simple polygons (no multipart, no holes) you can use geom.geo_interface to extract the vertices as a geojson string. For example:
shapefieldname = arcpy.Describe(dataset).ShapeFieldName

for row in arcpy.SearchCursor(dataset):
    print row.getValue(shapefieldname).__geo_inerface__
  • Otherwise if the geometry is more complex take a look at this sample script from the ESRI help on Reading Geometries.