[gdal-dev] New user query about OGR library NTF import

A.J. Carter ajc200 at maths.leeds.ac.uk
Sat Nov 14 13:49:22 EST 2009


Dear Frank,

Many thanks for your e-mail and such a rapid reply!

I don't want to suggest that there is necessarily a problem with the OGR 
library, it could well be that I simply don't understand what it is doing 
of course.

An example file is available on the OS web-site:

http://www.ordnancesurvey.co.uk/oswebsite/products/landformprofile/sampledata/lfprdntf.exe

(self extracting zip file)

and the technical reference which describes the format at

http://www.ordnancesurvey.co.uk/oswebsite/products/landformprofile/pdf/D05300_23%20Land-Form%20PROFILE%20UG%20TS.pdf

(see pdf page 29 onward).

In the NTF file the first record of 'type' 50 (i.e. data) starts

"510000000100000501-0030-0033..."

which I think means the first two grid point have heights -3.0m and -3.3m 
respectively (Z_MULT=0.1 hence X by 0.1).

In the OGRINFO -la output for the file (produced using FWtools246 under 
windows XP pro within a 32 bit virtual machine) the first two features 
are:

OGRFeature(DTM_SS78NE):1
   HEIGHT (Integer) = -3
   POINT (275000 185000 -3)

OGRFeature(DTM_SS78NE):2
   HEIGHT (Integer) = -3
   POINT (275000.0 185010.0 -3.299999952316284)

What I can't understand is why the height is reported as an integer and 
also where the figures after the decimal point in the z coordinate are 
coming from.

Overall what I am hoping to achive is a simple text file listing X, Y, Z 
(one per line of the file) coordinates for the land surface which can be 
fed into a surface generation program (surfer).

Any help in understanding the OGR output would be appreciated.

Best Wishes,
Alex


On Sat, 14 Nov 2009, Frank Warmerdam wrote:

> Alex,
>
> Can you provide access to an example file?  If
> distribution is an issue, you can make it available just
> to me.
>
> Best regards,
>
> On Sat, Nov 14, 2009 at 1:10 PM, A.J. Carter <ajc200 at maths.leeds.ac.uk> wrote:
>> Hello,
>>
>> I was hoping someone might be able to help me with a query about using the
>> OGR library to read an Ordnance Survey Landform Profile file in NTf format:
>>
>> http://www.ordnancesurvey.co.uk/oswebsite/products/landformprofile/techinfo.html
>>
>> The file contains a 501 X 501 grid with height values at each point. From
>> the technical reference on the OS web page it lists this as being stored
>> within a field called Z_COORD. Manually inspecting the NTF file (which is
>> plain text) I can see values like 00159 meaning 15.9m AOD. If I run the NTF
>> through OGRINFO -al on the file produces a feature for this point:
>>
>> OGRFeature)DTM_SD19SW):1
>>  HEIGHT (Integer) = 15
>>  POINT (310000.0 490000.0 15.899999618530273)
>>
>> At the moment I can't understand why it's writing out the height as an
>> integer, and also where the many decimal places in the z coordinate of the
>> point have come from.
>>
>> Any help would be much appreciated.
>>
>> I'm relatively new to GIS software; sorry if this is a silly question!
>>
>> Many thanks,
>> Alex
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
>
>
> -- 
> ---------------------------------------+--------------------------------------
> 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