Re: [gdal-dev] select shapes in a folder by geometry type

2013-05-28 Thread Pedro Costa

I was getting confused between version 1.1+ and 1.10+.
Aftercompile the latest, and used the '-dim' option worked.

thank you :-)









Em 24-05-2013 18:19, Eli Adam escreveu:

[1] ogr2ogr -f "ESRI Shapefile" -dim 2 pontos_2d.shp ocup_ilegal.shp

Yes just like this.


With this command don't work. I'm using 1.9 version but the '-dim' option
don't show up if i type  'ogr2ogr --long-usage'.

It is only in GDAL 1.10+ so it will not work in 1.9.

Eli



Em 24-05-2013 17:44, Eli Adam escreveu:


If you are using a recent version can you ignore geometry type and use
the -dim 2 switch?

-dim val:(starting with GDAL 1.10) Force the coordinate dimension to
val (valid values are 2 or 3). This affects both the layer geometry
type, and feature geometries.

Best Regards, Eli


On Fri, May 24, 2013 at 9:23 AM, Pedro Costa 
wrote:

Hi guys,

I'm trying  to make a script that converts 3d shapefiles to 2d.
I'm using the loop 'for...do'' and this command:

'ogr2ogr -f "ESRI Shapefile" -nlt POINT 2d_points/$shp $shp'

My problem is that i don't  know how to select only shapefiles of points,
and next only polygons, and next only lines to put the right geometry in
the
command.
For example, i have tried the '-where "OGR_GEOMETRY='Point'"'  like that:

ogr2ogr -where "OGR_GEOMETRY='Point'" -f "ESRI Shapefile" -nlt POLYGON
2d_poligonos/$shp $shp

But don't work because ogr converts shapefiles of polygons and lines into
points!

Can anyone tell me how i can select  only shapefiles of points in a
folder
with many shapefiles of many geometry types?

Thanks
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] select shapes in a folder by geometry type

2013-05-24 Thread Pedro Costa

Hi Eli,

Like that?[1]

[1] ogr2ogr -f "ESRI Shapefile" -dim 2 pontos_2d.shp ocup_ilegal.shp

With this command don't work. I'm using 1.9 version but the '-dim' 
option don't show up if i type  'ogr2ogr --long-usage'.



Em 24-05-2013 17:44, Eli Adam escreveu:

If you are using a recent version can you ignore geometry type and use
the -dim 2 switch?

-dim val:(starting with GDAL 1.10) Force the coordinate dimension to
val (valid values are 2 or 3). This affects both the layer geometry
type, and feature geometries.

Best Regards, Eli


On Fri, May 24, 2013 at 9:23 AM, Pedro Costa  wrote:

Hi guys,

I'm trying  to make a script that converts 3d shapefiles to 2d.
I'm using the loop 'for...do'' and this command:

'ogr2ogr -f "ESRI Shapefile" -nlt POINT 2d_points/$shp $shp'

My problem is that i don't  know how to select only shapefiles of points,
and next only polygons, and next only lines to put the right geometry in the
command.
For example, i have tried the '-where "OGR_GEOMETRY='Point'"'  like that:

ogr2ogr -where "OGR_GEOMETRY='Point'" -f "ESRI Shapefile" -nlt POLYGON
2d_poligonos/$shp $shp

But don't work because ogr converts shapefiles of polygons and lines into
points!

Can anyone tell me how i can select  only shapefiles of points in a folder
with many shapefiles of many geometry types?

Thanks
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] select shapes in a folder by geometry type

2013-05-24 Thread Pedro Costa

Hi guys,

I'm trying  to make a script that converts 3d shapefiles to 2d.
I'm using the loop 'for...do'' and this command:

'ogr2ogr -f "ESRI Shapefile" -nlt POINT 2d_points/$shp $shp'

My problem is that i don't  know how to select only shapefiles of 
points, and next only polygons, and next only lines to put the right 
geometry in the command.

For example, i have tried the '-where "OGR_GEOMETRY='Point'"'  like that:

ogr2ogr -where "OGR_GEOMETRY='Point'" -f "ESRI Shapefile" -nlt POLYGON 
2d_poligonos/$shp $shp


But don't work because ogr converts shapefiles of polygons and lines 
into points!


Can anyone tell me how i can select  only shapefiles of points in a 
folder with many shapefiles of many geometry types?


Thanks
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev