[gdal-dev] ogrinfo with remote KML-urls
Mateusz Loskot
mateusz at loskot.net
Tue Feb 23 14:34:04 EST 2010
Frank Warmerdam wrote:
> Mateusz Loskot wrote:
>>>> Is this a known issue that ogrinfo does not work with remote URLs?
>>> Stephan,
>>>
>>> I am not aware of any support in OGR for working on remote urls.
>>> There is
>>> an http driver in GDAL that sort of supports this for rasters, but I
>>> don't
>>> think the same thing exists in OGR.
>>
>> Frank,
>>
>> GeoJSON driver can read GeoJSON stream from remote resource.
>> Obviously, Stephan's URL does not point to GeoJSON file,
>> but KML, thus it fails.
>> AFAIK, the KML driver can't read from URL.
>
> Mateusz,
>
> Ah, I did not realize such magic existed in the geojson driver. How does
> it decide whether it ought to initate an expensive http request?
If protocol type is any of the three [1] then it decides to read.
> It *seems* like a bad idea to embed such behavior in a
> particular driver.
Yes, I understand your point.
Perhaps I should narrow the test with check if URL consists of "geojson"
token, like http://server/path/geojson/1234 or
ftp://server/path/file.geojson and if not present, then no remote
reading would be performed. Should I?
[1]
http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/geojson/ogrgeojsonutils.cpp#L92
[2]
http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/geojson/ogrgeojsondatasource.cpp#L369
Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
More information about the gdal-dev
mailing list