[GRASS-user] Vector drawings in PDF -> converting them

I have a TON of vector drawings available to me in PDF format that I'm georeferencing. So far, I'm doing it by converting them to PNGs and using r.to.vect to massage them. This is really tedious and the data isn't as clean as a straight vector conversion would be. In Illustrator, I can see that all the vector math is there. That is, the PDF isn't simply a wrapper around raster data.

I've tried opening the PDFs in Illustrator and exporting them as DXFs, but Grass ignores a lot of the data when I do this...they look very different in Grass once imported. I can export them as SVG from Illustrator, but surprisingly, there doesn't appear to be a single open-source tool available out there that converts SVG into some mainstream GIS file format.

Does anyone have experience doing this type of conversion? Pointers welcome.

ok, the problems are with the curves.

The ogr2ogr tool has a converter from Interlis to other ogrformats.
Interlis supports arcs (defined by three points). They also calculate new
vertices along the arcs to be compatible to other formats that don't
support curves. One can define how many

Every SVG viewer has code on how to display curves (arcs, quadratic and
cubic spline curves). But I don't know if you can dig up and work with
that code directly. Many of them probably forward their drawing commands
to underlying graphics libraries like Cairo, AGG, OpenVG, Java2D, etc.

As you said, you might also want to ask the Batik developers on the Batik
list. These people are usually friendly and often help where they can.

Andreas

Andreas,

Thanks for you comments. I agree completely.

The curves are definitely where the problem lies. There would need to
be a clever algorithm that converted them to polylines with some sort of
configurable resolution. However, my guess is the code used convert SVG
to raster formats like TIF and PNG has to do something similar.

I began looking into using the facilities in Batik to accomplish this.
The PNGTranscoder looks to be a good place to start. Haven't gotten
very far in this past weekend when I began to look into it, no blatant
roadblocks yet.

--Kurt

Andreas Neumann wrote:

Hi,

I don't have an immediate solution to your problem, however, I would
like
to discuss the use of the SVG format. Also, are you using curves in your
original data?

SVG would be a great format for transforming non-GIS vector maps into a
GIS format. But it is not so surprising that most GIS only export and
don't import SVG. SVG is usually a presentation format, not a transfer
format for GIS data. Also, SVG has a lot of features that can't be
easily
transfered to GIS - think about elliptical arcs, cubic and quadratic
spline curves. Those would have to be transfered into the OGC geometry
models, where support for curves is more or less in its infancy.

A number of GIS software allows the export of SVG, not always in a very
form, though: Postgis (ok), Grass (did not try that), Mapserver (haven't
tried that), ESRI (crappy, they seem to have some sort of "resolution"
for
their vector export).

But, I think it would be great to have svg support incorporated into the
ogr tools. It would make sense, also since FME and other OS and
commercial
GIS support SVG.

Andreas

I have a TON of vector drawings available to me in PDF format that I'm
georeferencing. So far, I'm doing it by converting them to PNGs and
using r.to.vect to massage them. This is really tedious and the data
isn't as clean as a straight vector conversion would be. In
Illustrator, I can see that all the vector math is there. That is, the
PDF isn't simply a wrapper around raster data.

I've tried opening the PDFs in Illustrator and exporting them as DXFs,
but Grass ignores a lot of the data when I do this...they look very
different in Grass once imported. I can export them as SVG from
Illustrator, but surprisingly, there doesn't appear to be a single
open-source tool available out there that converts SVG into some
mainstream GIS file format.

Does anyone have experience doing this type of conversion? Pointers
welcome.

--
Andreas Neumann
Böschacherstrasse 6, CH-8624 Grüt/Gossau, Switzerland
Email: a.neumann@carto.net, Web:
* http://www.carto.net/ (Carto and SVG resources)
* http://www.carto.net/neumann/ (personal page)
* http://www.svgopen.org/ (SVG Open Conference)
* http://www.geofoto.ch/ (Georeferenced Photos of Switzerland)

Within Illustrator maybe you can build a script that adds intermediate
points to curves (don't really remember, but it sounds like 'densify
paths', or 'add anchor points'), attended that vertices will be
recognized when imported

Vincent

Le jeudi 17 janvier 2008 à 09:03 +0100, Andreas Neumann a écrit :

ok, the problems are with the curves.

The ogr2ogr tool has a converter from Interlis to other ogrformats.
Interlis supports arcs (defined by three points). They also calculate new
vertices along the arcs to be compatible to other formats that don't
support curves. One can define how many

Every SVG viewer has code on how to display curves (arcs, quadratic and
cubic spline curves). But I don't know if you can dig up and work with
that code directly. Many of them probably forward their drawing commands
to underlying graphics libraries like Cairo, AGG, OpenVG, Java2D, etc.

As you said, you might also want to ask the Batik developers on the Batik
list. These people are usually friendly and often help where they can.

Andreas

> Andreas,
>
> Thanks for you comments. I agree completely.
>
> The curves are definitely where the problem lies. There would need to
> be a clever algorithm that converted them to polylines with some sort of
> configurable resolution. However, my guess is the code used convert SVG
> to raster formats like TIF and PNG has to do something similar.
>
> I began looking into using the facilities in Batik to accomplish this.
> The PNGTranscoder looks to be a good place to start. Haven't gotten
> very far in this past weekend when I began to look into it, no blatant
> roadblocks yet.
>
> --Kurt
>
> Andreas Neumann wrote:
>> Hi,
>>
>> I don't have an immediate solution to your problem, however, I would
>> like
>> to discuss the use of the SVG format. Also, are you using curves in your
>> original data?
>>
>> SVG would be a great format for transforming non-GIS vector maps into a
>> GIS format. But it is not so surprising that most GIS only export and
>> don't import SVG. SVG is usually a presentation format, not a transfer
>> format for GIS data. Also, SVG has a lot of features that can't be
>> easily
>> transfered to GIS - think about elliptical arcs, cubic and quadratic
>> spline curves. Those would have to be transfered into the OGC geometry
>> models, where support for curves is more or less in its infancy.
>>
>> A number of GIS software allows the export of SVG, not always in a very
>> form, though: Postgis (ok), Grass (did not try that), Mapserver (haven't
>> tried that), ESRI (crappy, they seem to have some sort of "resolution"
>> for
>> their vector export).
>>
>> But, I think it would be great to have svg support incorporated into the
>> ogr tools. It would make sense, also since FME and other OS and
>> commercial
>> GIS support SVG.
>>
>> Andreas
>>
>>
>>> I have a TON of vector drawings available to me in PDF format that I'm
>>> georeferencing. So far, I'm doing it by converting them to PNGs and
>>> using r.to.vect to massage them. This is really tedious and the data
>>> isn't as clean as a straight vector conversion would be. In
>>> Illustrator, I can see that all the vector math is there. That is, the
>>> PDF isn't simply a wrapper around raster data.
>>>
>>> I've tried opening the PDFs in Illustrator and exporting them as DXFs,
>>> but Grass ignores a lot of the data when I do this...they look very
>>> different in Grass once imported. I can export them as SVG from
>>> Illustrator, but surprisingly, there doesn't appear to be a single
>>> open-source tool available out there that converts SVG into some
>>> mainstream GIS file format.
>>>
>>> Does anyone have experience doing this type of conversion? Pointers
>>> welcome.
>>>
>>
>>
>
>

On Wednesday 16 January 2008 11:22:02 pm Kurt Heston wrote:

I have a TON of vector drawings available to me in PDF format that I'm
georeferencing. So far, I'm doing it by converting them to PNGs and
using r.to.vect to massage them. This is really tedious and the data
isn't as clean as a straight vector conversion would be. In
Illustrator, I can see that all the vector math is there. That is, the
PDF isn't simply a wrapper around raster data.

I've tried opening the PDFs in Illustrator and exporting them as DXFs,
but Grass ignores a lot of the data when I do this...they look very
different in Grass once imported. I can export them as SVG from
Illustrator, but surprisingly, there doesn't appear to be a single
open-source tool available out there that converts SVG into some
mainstream GIS file format.

Does anyone have experience doing this type of conversion? Pointers
welcome.
_______________________________________________

Check out Inkscape.

Dylan

--
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341

Dylan,

Will do. Is there a specific feature I should look for that solves my specific problem?

--K

Dylan Beaudette wrote:

On Wednesday 16 January 2008 11:22:02 pm Kurt Heston wrote:
  

I have a TON of vector drawings available to me in PDF format that I'm
georeferencing. So far, I'm doing it by converting them to PNGs and
using r.to.vect to massage them. This is really tedious and the data
isn't as clean as a straight vector conversion would be. In
Illustrator, I can see that all the vector math is there. That is, the
PDF isn't simply a wrapper around raster data.

I've tried opening the PDFs in Illustrator and exporting them as DXFs,
but Grass ignores a lot of the data when I do this...they look very
different in Grass once imported. I can export them as SVG from
Illustrator, but surprisingly, there doesn't appear to be a single
open-source tool available out there that converts SVG into some
mainstream GIS file format.

Does anyone have experience doing this type of conversion? Pointers
welcome.
_______________________________________________
    
Check out Inkscape.

Dylan

On Thursday 17 January 2008 11:10:39 am Kurt Heston wrote:

Dylan,

Will do. Is there a specific feature I should look for that solves my
specific problem?

--K

Kurt-

Well, I would take a look at all of the vector (path) tools available in
Inkscape. I have not used to to work with much GIS data, but I do know that
it can import PDF data as vector (path) primitives.

Feel free to post your findings back to the list.

Cheers,

Dylan

Dylan Beaudette wrote:
> On Wednesday 16 January 2008 11:22:02 pm Kurt Heston wrote:
>> I have a TON of vector drawings available to me in PDF format that I'm
>> georeferencing. So far, I'm doing it by converting them to PNGs and
>> using r.to.vect to massage them. This is really tedious and the data
>> isn't as clean as a straight vector conversion would be. In
>> Illustrator, I can see that all the vector math is there. That is, the
>> PDF isn't simply a wrapper around raster data.
>>
>> I've tried opening the PDFs in Illustrator and exporting them as DXFs,
>> but Grass ignores a lot of the data when I do this...they look very
>> different in Grass once imported. I can export them as SVG from
>> Illustrator, but surprisingly, there doesn't appear to be a single
>> open-source tool available out there that converts SVG into some
>> mainstream GIS file format.
>>
>> Does anyone have experience doing this type of conversion? Pointers
>> welcome.
>> _______________________________________________
>
> Check out Inkscape.
>
> Dylan

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

--
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341

Grass 6.2 appears to be even less agreeable to the DXF format that Inkscape writes than it was to the one Illustrator did. I'm still playing with it, but no luck yet.

Dylan Beaudette wrote:

On Thursday 17 January 2008 11:10:39 am Kurt Heston wrote:
  

Dylan,

Will do. Is there a specific feature I should look for that solves my
specific problem?

--K
    
Kurt-

Well, I would take a look at all of the vector (path) tools available in Inkscape. I have not used to to work with much GIS data, but I do know that it can import PDF data as vector (path) primitives.

Feel free to post your findings back to the list.

Cheers,

Dylan

Dylan Beaudette wrote:
    

On Wednesday 16 January 2008 11:22:02 pm Kurt Heston wrote:
      

I have a TON of vector drawings available to me in PDF format that I'm
georeferencing. So far, I'm doing it by converting them to PNGs and
using r.to.vect to massage them. This is really tedious and the data
isn't as clean as a straight vector conversion would be. In
Illustrator, I can see that all the vector math is there. That is, the
PDF isn't simply a wrapper around raster data.

I've tried opening the PDFs in Illustrator and exporting them as DXFs,
but Grass ignores a lot of the data when I do this...they look very
different in Grass once imported. I can export them as SVG from
Illustrator, but surprisingly, there doesn't appear to be a single
open-source tool available out there that converts SVG into some
mainstream GIS file format.

Does anyone have experience doing this type of conversion? Pointers
welcome.
_______________________________________________
        

Check out Inkscape.

Dylan
      

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user