[Gdal-dev] ogr2ogr Point not Point ZM

Frank Warmerdam warmerdam at pobox.com
Fri Jan 6 14:13:25 EST 2006


On 1/5/06, Alex Mandel <tech_dev at wildintellect.com> wrote:
> When I do:
> ogr2ogr -update -append two.shp one -nln two one -nlt POINT
>
> The appended file, which has no points to begin with(but is basically
> the same as the original with a couple of extra fields and the points
> removed) ends up with geometry of type POINT ZM(3D). I need it to simply
> be POINT(2D), no z or m values. ArcGIS software handles POINT and POINT
> ZM very  differently so they are two distinctly different options.
>
> I thought I had solved it by adding the -nlt POINT portion but it turns
> out that didn't have any effect.
>
> Whats really wierd is that I thought I had this working on a previous
> data set.

Folks,

For posterity with Alex's help I was able to determine that
ogr2ogr was actually altering the dimension of the shapefile.
This was the result of two bugs.

1) the OGRPoint::clone() method was not preserving the
   dimension of the source point properly.  I have fixed this.

2) the OGRShapeLayer::CreateFeature() method was setup to
    fix the type of the shapefile based on the first feature written
    if it had no previous information.  I had only intended this to
    apply in the case of a newly created layer, but by a quirk of
    the code it also applied to empty existing files that get
    opened.  I have fixed this.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list