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 `&`. 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
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to