gdal icon indicating copy to clipboard operation
gdal copied to clipboard

Unable to Open SVG

Open evan203 opened this issue 1 year ago • 10 comments

Expected behavior and actual behavior.

I expected to be able to open a SVG file. The following SVG is generated from a PDF using pdftocairo -svg. I have also tried to use a svg generated from adobe illustrator (from the same pdf).

Steps to reproduce the problem.

ogrinfo "Asset 1.svg"
ERROR 4: `Asset 1.svg' not recognized as a supported file format.
ogrinfo failed - unable to open 'Asset 1.svg'.

ogrinfo --formats lists I have SVG as a supported format: SVG -vector- (rov): Scalable Vector Graphics

Operating system

Windows 11 23H2

GDAL version and provenance

GDAL 3.8.4 from osgeo4w.

Relevant files

Asset 1.pdf

Asset 1.svg

AI exported asset 1.svg

evan203 avatar Feb 26 '24 20:02 evan203

As documented in https://gdal.org/drivers/vector/svg.html : "Currently, it will only read SVG files that are the output from Cloudmade Vector Stream Server"

rouault avatar Feb 26 '24 20:02 rouault

Does Cloudmade Vector Stream Server even exist any more?

jratike80 avatar Feb 26 '24 20:02 jratike80

Does Cloudmade Vector Stream Server even exist any more?

apparently not : https://qgis-user.osgeo.narkive.com/p6nWarcj/add-svg-as-vector-layer "It looks like this product is "Cloudmade Vector Stream Server", which appears to be a dead web service?

I guess the driver could be extended to be more generic. The Cloudmade stuff allowed to produced georeferenced datasets. A more generic SVG reader would produce arbitrary vector coordinates. Reopening for a potential contributor willing to have a take on that.

rouault avatar Feb 26 '24 20:02 rouault

@rouault is that a new requirement? I distinctly remember opening a Inkscape exported svg using ogr sometime around ~5 years ago

nyalldawson avatar Feb 26 '24 21:02 nyalldawson

is that a new requirement?

no, it's not new. As far as I can see, it exists since day 1 (71ab469144a3666489283d3362e05a21e9470991)

rouault avatar Feb 26 '24 21:02 rouault

@rouault

Guess my memory is a bit leaky then! :laughing: (Maybe I went Inkscape SVG -> svg to dxf -> OGR...)

nyalldawson avatar Feb 26 '24 23:02 nyalldawson

going from SVG to DXF sucks and I lose a lot of detail, unfortunate.

WilliamHarrisonGB avatar Sep 19 '24 15:09 WilliamHarrisonGB

You mean going from SVG to DXF with Inkscape sucks, or?

Should we remove the SVG driver altogether because I think it is rather useless as it stands now?

jratike80 avatar Sep 19 '24 19:09 jratike80

You mean going from SVG to DXF with Inkscape sucks, or?

Should we remove the SVG driver altogether because I think it is rather useless as it stands now?

Going from SVG to DXF so GDAL support it, is what sucks. SVG driver is basically useless right now, you can't use it.

WilliamHarrisonGB avatar Sep 20 '24 21:09 WilliamHarrisonGB

Going from SVG to DXF so GDAL support it, is what sucks. SVG driver is basically useless right now, you can't use it.

The GDAL side does not really suck because the SVG driver has always been useless for that purpose. That is a missing feature, GDAL has never had a generic SVG driver. The limitation of the driver is documented "Currently, it will only read SVG files that are the output from Cloudmade Vector Stream Server".

Because the Vector Stream Server does not exist any more I think that the driver could be removed.

jratike80 avatar Sep 21 '24 09:09 jratike80