Quantcast
Channel: Question and Answer » gdal
Viewing all articles
Browse latest Browse all 397

OSM linestring shown as point

$
0
0

I have loaded the following file http://openstreetmapdata.com/data/coastlines to postgreSQL. In visual studio with gdal/ogr and geos enabled:
SELECT geom
FROM waterpoly
WHERE geom IS NOT NULL LIMIT 10;

Stored the result in std::vector* multigeom;

In a for loop

OGRGeometry* geo  =  multigeom->at(i);
printf("geo type: %ld n",geo->getGeometryType());

I expected it to be ‘wkbMultiLineString’ (because it says line strings in the above osm website) but the answer was ‘wkbPoint’.

Regardless, I have done the following:

OGRMultiLineString* mult = (OGRMultiLineString*) multigeom->at(i);
for( int j = 0; j < mult->getNumGeometries() ; j++ ) 
{
OGRGeometry* geogeom =  (OGRGeometry*) mult->getGeometryRef(j);
printf("geo type: %ld n",geogeom->getGeometryType());

}

Answer was ‘wkbunknown’

Can anybody give me the reason behind this? or am I doing anything wrong?


Viewing all articles
Browse latest Browse all 397

Trending Articles