[gdal-dev] issue with Virtual Format and a remote CSV service

Martin Ouellet geomartino at gmail.com
Wed Mar 25 06:08:04 PDT 2015


Thanks Even for the quick response.  Is it ok to escape : (with %3A) and
the comma (with %2C) in the vrt?

even with the prefix , I received another error:
OGR error. Failed to open datasource `/vsicurl/http://<my
server>:8080/solr-geo2/collection2/select?q=*%3A*&fl=PHOTO_LATITUDE%2CPHOTO_LONGITUDE%2CID&wt=csv'

cheers,

MartinO

On Tue, Mar 24, 2015 at 5:21 PM Even Rouault <even.rouault at spatialys.com>
wrote:

> Le mardi 24 mars 2015 22:16:30, Martin Ouellet a écrit :
> > Hi all,
> >
> > I have a solr service which provide a valid csv response like this:
> >
> > PHOTO_LATITUDE,PHOTO_LONGITUDE,ID
> > 49.482333,-82.580556,A21524-047-1970-0
> > 49.485278,-82.640444,A21524-048-1970-0
> > 49.487583,-82.701194,A21524-049-1970-0
> > 49.490444,-82.761111,A21524-050-1970-0
> > 49.490333,-82.824333,A21524-051-1970-0
> >
> > my vrt is:
> >
> > <OGRVRTDataSource>
> > <OGRVRTLayer name="coord">
> > <SrcDataSource>http://solr/select?q=*%3A*&fl=PHOTO_
> LATITUDE%2CPHOTO_LONGITU
> > DE%2CID&wt=csv</SrcDataSource> <SrcLayer>coord</SrcLayer>
> > <GeometryType>wkbPoint</GeometryType>
> > <LayerSRS>WGS84</LayerSRS>
> > <GeometryField encoding="PointFromColumns" x="PHOTO_LONGITUDE"
> > y="PHOTO_LATITUDE"/>
> > </OGRVRTLayer>
> > </OGRVRTDataSource>
> >
> > I've try to escape the & with & in the url like the suggestions
> > here
> > <http://osgeo-org.1560.x6.nabble.com/Define-Virtual-
> Format-for-a-remote-Ge
> > oJSON-file-td5173766.html>but in all cases, I still receive this error:
> >
> > msOGRFileNextShape(): OGR error. Failed to read GeoJSON data
>
> You need to do XML escaping indeed (& --> &) and also prefix the URL by
> /vsicurl/ (the GeoJSON driver is the exception in that it tries to
> interpret
> any string by http:// as a potential source for it)
>
> >
> > any ideas?
> >
> > MartinO
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150325/a990b0cf/attachment.html>


More information about the gdal-dev mailing list