[gdal-dev] How do I open vector files (e.g. shp) using GDAL

Peter J Halls P.Halls at york.ac.uk
Tue Jul 21 04:02:04 EDT 2009


There is the GDAL rasterize method, however that is designed to translate vector 
polygons into raster representations.  Converting points to raster is a very 
simple task and does not really need a method; converting lines is slightly less 
trivial, however these are issues with regard to how to represent phenomena that 
have no width in a cellular environment which the user will need to consider.

Peter

Smart, Gary wrote:
> Oh - I see.  I can open them now and wander through their layers and vector points.  Thank you.
> 
> I don't suppose there is a utility/convience function to 'rasterize' the information within a 2D vector file (e.g. vector map) by any chance (i.e. rather than drawing them using OpenGL or something)?
> 
> Gary
> 
>> -----Original Message-----
>> From: Even Rouault [mailto:even.rouault at mines-paris.org]
>> Sent: 20 July 2009 22:03
>> To: gdal-dev at lists.osgeo.org
>> Cc: Smart, Gary
>> Subject: Re: [gdal-dev] How do I open vector files (e.g. shp) using GDAL
>>
>> Le Monday 20 July 2009 22:51:13 Smart, Gary, vous avez écrit :
>>> I understand that GDAL can open vector formats as if they were a
>>> dataset?
>>>
>> No, not exactly. GDAL is for the raster formats. OGR is for the vector
>> formats. They have each their concepts, API and notions. See the OGR
>> documentation : http://gdal.org/ogr/
>>
>>>
>>> E.g. I read that it is possible to pass the GDALOpen either a single
>>> .shp file (in which case it treats it as if it only had one layer) or a
>>> directory containing multiple .shp files - which presumably it opens as
>>> multi layered?
>>>
>>>
>>>
>>> However, whenever I try to open vector files in this way (directory or
>>> file) I get...
>>>
>>>
>>>
>>> ERROR 4  - blah blah is not recognised as a supported file format"
>>>
>>>
>>>
>>> I am still new to all this (having only just conquered raster formats)
>>> so I suspect I am doing something pretty dumb.
>>>
>>> Perhaps someone can help?
>>>
>>>
>>>
>>> Gary
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
--------------------------------------------------------------------------------
Peter J Halls, GIS Advisor, University of York
Telephone: 01904 433806     Fax: 01904 433740
Snail mail: Computing Service, University of York, Heslington, York YO10 5DD
This message has the status of a private and personal communication
--------------------------------------------------------------------------------


More information about the gdal-dev mailing list