Skip to main content
Tweeted twitter.com/#!/StackGIS/status/127958765948510208
added 4 characters in body; edited tags; edited title
Source Link
underdark
  • 84.5k
  • 22
  • 233
  • 415

How to convert geometry of a feature of shapefileShapefile geometries to WKB using OGR?

I got the geometry of a feature of the shapefile, and i want to save that geometry in the postgis (in WKB formats like it happens when we import shapefiles using shp2pgsql and psql commands). How do I convert then

To get Geometry i have used osgeoOSGeo OGR library eg:

feat = layer.GetFeature(0)
geometry = feat.GetGeometryRef()

and I have got

<osgeo.ogr.Geometry; proxy of <Swig Object of type 'OGRGeometryShadow *' at 0x0096A2D8> >

so how will convert it into the WKB geometry? I am using Python for this.

convert geometry of a feature of shapefile to WKB

I got the geometry of a feature of the shapefile, and i want to save that geometry in the postgis (in WKB formats like it happens when we import shapefiles using shp2pgsql and psql commands). How do I convert then

To get Geometry i have used osgeo library eg:

feat = layer.GetFeature(0)
geometry = feat.GetGeometryRef()

and I have got

<osgeo.ogr.Geometry; proxy of <Swig Object of type 'OGRGeometryShadow *' at 0x0096A2D8> >

so how will convert it into the WKB geometry? I am using Python for this.

How to convert Shapefile geometries to WKB using OGR?

I got the geometry of a feature of the shapefile, and i want to save that geometry in the postgis (in WKB formats like it happens when we import shapefiles using shp2pgsql and psql commands). How do I convert then

To get Geometry i have used OSGeo OGR library eg:

feat = layer.GetFeature(0)
geometry = feat.GetGeometryRef()

and I have got

<osgeo.ogr.Geometry; proxy of <Swig Object of type 'OGRGeometryShadow *' at 0x0096A2D8> >

so how will convert it into the WKB geometry? I am using Python for this.

I got the geometry of a feature of the shapefile, and i want to save that geometry in the postgis (in WKB formats like it happens when we import shapefiles using shp2pgsql and psql commands). How do I convert then

To get GoemtryGeometry i have used osgeo library eg: feat = layer.GetFeature(0) geometry = feat.GetGeometryRef() and

feat = layer.GetFeature(0)
geometry = feat.GetGeometryRef()

and I have got <osgeo.ogr.Geometry; proxy of <Swig Object of type 'OGRGeometryShadow *' at 0x0096A2D8> >

<osgeo.ogr.Geometry; proxy of <Swig Object of type 'OGRGeometryShadow *' at 0x0096A2D8> >

so how will convert it into the WKB geometry...? I am using Python for this  .

I got the geometry of a feature of the shapefile, and i want to save that geometry in the postgis (in WKB formats like it happens when we import shapefiles using shp2pgsql and psql commands). How do I convert then

To get Goemtry i have used osgeo library eg: feat = layer.GetFeature(0) geometry = feat.GetGeometryRef() and I have got <osgeo.ogr.Geometry; proxy of <Swig Object of type 'OGRGeometryShadow *' at 0x0096A2D8> >

so how will convert it into the WKB geometry... I am using Python for this  .

I got the geometry of a feature of the shapefile, and i want to save that geometry in the postgis (in WKB formats like it happens when we import shapefiles using shp2pgsql and psql commands). How do I convert then

To get Geometry i have used osgeo library eg:

feat = layer.GetFeature(0)
geometry = feat.GetGeometryRef()

and I have got

<osgeo.ogr.Geometry; proxy of <Swig Object of type 'OGRGeometryShadow *' at 0x0096A2D8> >

so how will convert it into the WKB geometry? I am using Python for this.

Source Link
Vicky
  • 1.9k
  • 3
  • 22
  • 28

convert geometry of a feature of shapefile to WKB

I got the geometry of a feature of the shapefile, and i want to save that geometry in the postgis (in WKB formats like it happens when we import shapefiles using shp2pgsql and psql commands). How do I convert then

To get Goemtry i have used osgeo library eg: feat = layer.GetFeature(0) geometry = feat.GetGeometryRef() and I have got <osgeo.ogr.Geometry; proxy of <Swig Object of type 'OGRGeometryShadow *' at 0x0096A2D8> >

so how will convert it into the WKB geometry... I am using Python for this .