Define Virtual Format for a remote GeoJSON file

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Define Virtual Format for a remote GeoJSON file

aborruso
Hi all,
is it possible to define a Virtual Format of a remote GeoJSON file?

I would like to built a VRT file in example using this GeoJSON remote URL:
"http://www.provincia.caltanissetta.sitr.it/ArcGIS/rest/services/Immobili/MapServer/0/query?where=objectid+%3D+objectid&outfields=*&f=json"


Thank you,

Andrea
Reply | Threaded
Open this post in threaded view
|

Re: Define Virtual Format for a remote GeoJSON file

Even Rouault-2
Le mercredi 19 novembre 2014 12:40:03, aborruso a écrit :
> Hi all,
> is it possible to define a Virtual Format of a remote GeoJSON file?
>
> I would like to built a VRT file in example using this GeoJSON remote URL:
> "http://www.provincia.caltanissetta.sitr.it/ArcGIS/rest/services/Immobili/M
> apServer/0/query?where=objectid+%3D+objectid&outfields=*&f=json"
>

Andrea,

Yes, you can use the URL as the datasource name expected by the VRT format.

Even

>
> Thank you,
>
> Andrea
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Define-Virtual-Format-for-a-remote-Geo
> JSON-file-tp5173766.html Sent from the GDAL - Dev mailing list archive at
> Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Define Virtual Format for a remote GeoJSON file

aborruso
Hi Even,
thank you.

Even Rouault-2 wrote
Yes, you can use the URL as the datasource name expected by the VRT format.
I have tried with:
<OGRVRTDataSource>
        <OGRVRTLayer name="OGRGeoJSON">
                <SrcDataSource>http://www.provincia.caltanissetta.sitr.it/ArcGIS/rest/services/Immobili/MapServer/0/query?where=objectid+%3D+objectid&outfields=*&f=json</SrcDataSource>
                <LayerSRS>EPSG:3004</LayerSRS>
                <SrcLayer>OGRGeoJSON</SrcLayer> 
        </OGRVRTLayer>
</OGRVRTDataSource>

But if I run "ogrinfo -ro my_virtual_format_file.vrt" I have:
INFO: Open of `my_virtual_format_file.vrt'
      using driver `VRT' successful.
1: OGRGeoJSONERROR 4: Failed to read GeoJSON data

If I run:
ogrinfo -ro  "http://www.provincia.caltanissetta.sitr.it/ArcGIS/rest/services/Immobili/MapServer/0/query?where=objectid+%3D+objectid&outfields=*&f=json" OGRGeoJSON -summary

It's all OK.

What's wrong in my VRT definition?

Thank you again,

a
Reply | Threaded
Open this post in threaded view
|

Re: Define Virtual Format for a remote GeoJSON file

Homme Zwaagstra
Hi Andrea,

The VRT is an XML format and hence you need to ensure the content is XML compliant: your URL contained `&` characters that need to be escaped to `&amp;`.  The following VRT works for me:

<OGRVRTDataSource>
  <OGRVRTLayer name="OGRGeoJSON">
    <SrcDataSource>http://www.provincia.caltanissetta.sitr.it/ArcGIS/rest/services/Immobili/MapServer/0/query?where=objectid+%3D+objectid&amp;outfields=*&amp;f=json</SrcDataSource>
    <LayerSRS>EPSG:3004</LayerSRS>
    <SrcLayer>OGRGeoJSON</SrcLayer>
  </OGRVRTLayer>
</OGRVRTDataSource>

Best regards,

Homme

On 19/11/14 13:22, aborruso wrote:
> Hi Even,
> thank you.
>
>
> Even Rouault-2 wrote
>> Yes, you can use the URL as the datasource name expected by the VRT
>> format.
>
> I have tried with:
> <OGRVRTDataSource>
>     <OGRVRTLayer name="OGRGeoJSON">
>    
> <SrcDataSource>http://www.provincia.caltanissetta.sitr.it/ArcGIS/rest/services/Immobili/MapServer/0/query?where=objectid+%3D+objectid&outfields=*&f=json</SrcDataSource>
>         <LayerSRS>EPSG:3004</LayerSRS>
>         <SrcLayer>OGRGeoJSON</SrcLayer>
>     </OGRVRTLayer>
> </OGRVRTDataSource>
>
> But if I run "ogrinfo -ro my_virtual_format_file.vrt" I have:
> INFO: Open of `my_virtual_format_file.vrt'
>       using driver `VRT' successful.
> 1: OGRGeoJSONERROR 4: Failed to read GeoJSON data
>
> If I run:
> ogrinfo -ro
> "http://www.provincia.caltanissetta.sitr.it/ArcGIS/rest/services/Immobili/MapServer/0/query?where=objectid+%3D+objectid&outfields=*&f=json"
> OGRGeoJSON -summary
>
> It's all OK.
>
> What's wrong in my VRT definition?
>
> Thank you again,
>
> a
>
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/Define-Virtual-Format-for-a-remote-GeoJSON-file-tp5173766p5173799.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev




_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Define Virtual Format for a remote GeoJSON file

aborruso
Hi hrz,

hrz wrote
The VRT is an XML format and hence you need to ensure the content is XML
compliant: your URL contained `&` characters that need to be escaped to
`&`.  The following VRT works for me:
I'm stupid :)

It works good.

Thank you very much,

Andrea