[Gdal-dev] using a feature to store a "Track"

Tyler Mitchell TMitchell at lignum.com
Wed Dec 10 13:05:21 EST 2003





Do you a have specific OGR format in mind?  Would using a database be more
flexible than a file format?

Also,
I've used OGR, Python and PostGIS to grab GPS waypoints from a Garmin
receiver and hoped to tackle tracks in the future too.  If you are
interested in sharing code, drop me a note off-list (tmitchell at lignum.com).

Tyler



                                                                           
             Frank Warmerdam                                               
             <warmerdam at pobox.                                             
             com>                                                       To 
             Sent by:                  gdal-dev at remotesensing.org          
             gdal-dev-admin at re                                          cc 
             motesensing.org                                               
                                                                    Fax to 
                                                                           
             12/10/2003 09:39                                      Subject 
             AM                        Re: [Gdal-dev] using a feature to   
                                       store a "Track"                     
                                                                           
             Please respond to                                             
             gdal-dev at remotese                                             
                 nsing.org                                                 
                                                                           
                                                                           




mathieu_gdal wrote:
> Dear All,
>
> I have a very basic question, I would like to know if my approach is
> good or not at all.
>
> I have a list of points, called "a track". Each point is defined by :
> - a position (in lat,lon,WGS84)
> - an altitude
> - a heading (it is an example)
>
> I would like to use the class OGRFeature to store this "Track".
> The Track's Geometry (lat, lon, and altitude) is very well managed in
> the OGRFeature (OGRFeature::poGeometry)
> But how to store the other attributes, such as heading?
>
> My idea is to store the heading in a feature's special attribute, as a
> list of double.
> This size of this list would be the same as the geometry size.
> To retrieve a specific point, I will have to retrieve its position with
> the geometry, and the heading with the "double list" attribute.
> It might be costly if I want to store many other parameters for each
> point.

Mathieu,

This approach will work but the caveat is that very view OGR file formats
are going to support saving the list of doubles attribute type.  One low
tech alternative is to just keep the list of headings in string attribute
with commas between the values.  As long as the format you want to work
with supports long strings this should be OK.

The Shapefile format can actually store X, Y, Z and "M" for each geometry
vertex.  It would be ideal to map your heading to this measure value;
however,
the current OGR Shapefile driver has no support for reading or writing to
the
measure value.  Another approach might be to try and take advantage of this
by updating the Shapefile driver (the lower level Shapelib works just fine
for the measure values).

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


_______________________________________________
Gdal-dev mailing list
Gdal-dev at remotesensing.org
http://remotesensing.org/mailman/listinfo/gdal-dev





More information about the Gdal-dev mailing list