Jump to content

 
Photo

export Illustrator notes?

- - - - -

  • Please log in to reply
12 replies to this topic

#1
bramapic

bramapic

    Newbie

  • Validated Member
  • Pip
  • 5 posts
  • Gender:Male
  • Belgium

Hi all

I'm wondering if someone can help me with a problem I'm having.

I have several Illustrator (6) files containing lines (streets).
Every street holds information stored as Notes displayed in the Attributes window in Illustrator.

Now I would like to extract these data to shape files (for example) holding these notes as... well attributes.
To convert the data to a geo format, I use FME.
However, I can't seem to find a format readable by FME that keeps the illustrator notes during export.

I've attached a screenshot with an example.

Attached File  Attributes.jpg   111.8KB   53 downloads

Thanks in advance

Bram

#2
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,898 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

Hello Bram,

FME won't help you here I'm afraid.

If you can send me a sample file I'd be happy to see if there's any way to get the data out of there, but I fear it's going to be very difficult.
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#3
bramapic

bramapic

    Newbie

  • Validated Member
  • Pip
  • 5 posts
  • Gender:Male
  • Belgium

Dag Hans ;)

I was afraid of that. Another solution would be to use the text on curve as attributes, but streetnames were chopped for use on multilines. This would leave a large percentage of the streetnames incomplete.

I'll prepare a small sample for you.


Thanks

Bram

#4
Michael Schmeling

Michael Schmeling

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 206 posts
  • Gender:Male
  • Location:Kassel, Germany
  • Germany

I think it should be possible to do something with a script.

The PathItem has a property 'note'. You could read it and write it to an ASCII file, for example.
Michael Schmeling
Kassel, Germany
Arid Ocean Map Illustrations
http://maps.aridocean.com
Indie Cartographer
http://www.indiecartographer.com

#5
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,320 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

I wonder if you would be able to get this information if you save the file as an uncompressed eps-file (which is a text-file).
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#6
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,898 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

I wonder if you would be able to get this information if you save the file as an uncompressed eps-file (which is a text-file).


Either that or one of the older Illustrator versions (8 if I'm not mistaken). But then you'd have to essentially write your own FME reader for that format, as FME only supports writing to EPS and AI.
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#7
bramapic

bramapic

    Newbie

  • Validated Member
  • Pip
  • 5 posts
  • Gender:Male
  • Belgium

Indeed, I seem to remember a small script that parsed the illustrator files (saved as Illustrator < 8 versions) to produce indexes in combination with a grid.

I'll do some testing with legacy formats to see if I can extract the attributes this way.

#8
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,898 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

Indeed, I seem to remember a small script that parsed the illustrator files (saved as Illustrator < 8 versions) to produce indexes in combination with a grid.

I'll do some testing with legacy formats to see if I can extract the attributes this way.


I did a quick test, 2 rectangles and a circle, exported to AI8. Here's the relevant bit from the file.

%AI5_BeginLayer1 1 1 1 0 0 1 0 79 128 255 0 50 Lb(Layer 1) Ln0 A%AI3_Note:rechthoek 11 Ap0 O0 0 0 0 k0 R0 0 0 1 K0 J 0 j 1 w 10 M []0 d0 XR105.1748 -171.1118 m52.0278 -171.1118 L52.0278 -122.8604 L105.1748 -122.8604 L105.1748 -171.1118 Lb%AI3_Note:rechthoek 2207.9722 -296.2866 m140.8394 -296.2866 L140.8394 -220.063 L207.9722 -220.063 L207.9722 -296.2866 Lb%AI3_Note:cirkel 1410.0698 -190.6924 m410.0698 -221.5894 383.6138 -246.6362 350.979 -246.6362 c318.3442 -246.6362 291.8882 -221.5894 291.8882 -190.6924 c291.8882 -159.7949 318.3442 -134.748 350.979 -134.748 c383.6138 -134.748 410.0698 -159.7949 410.0698 -190.6924 cbLB%AI5_EndLayer--

If only I knew what those codes all meant it wouldn't actually be too difficult to write an FME reader for this (provided there's no complex geometries), just a lot of trial and error. Still wouldn't be georeferenced of course.
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#9
bramapic

bramapic

    Newbie

  • Validated Member
  • Pip
  • 5 posts
  • Gender:Male
  • Belgium

Yes I know, I'm conveniently leaving the georeferencing part out for now.
I figured, once I get all lines and attributes in FME, I can start from there.

An Illustrator 8 export of some streets show these lines:

%AI3_Note:#92079#,#23300590#,#MARKT (MERKSPLAS)#

1567.0254 1459.3936 m

1577.9707 1458.04 l

S

%AI3_Note:#110318#,#23300720#,#PASTORIJSTRAAT (MERKSPLAS)#

1575.3145 1491.3882 m

1568.4492 1492.6909 l

1560.4316 1495.5322 l

1554.6729 1499.4282 l

1525.4551 1525.9248 l

1519.6484 1530.981 l

S

%AI3_Note:#137988#,#23300870#,#STEENWEG OP HOOGSTRATEN (MERKSPLAS)#

1324.1563 1702.0508 m

1346.8169 1682.2891 l

1381.0332 1651.3701 l

1428.2637 1611.1572 l

1459.2578 1583.6899 l

1480.1582 1566.0039 l

1519.6484 1530.981 l

S

Looks like I have some googling to do on writing FME readers.



Thanks for your help.

#10
l.jegou

l.jegou

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 114 posts
  • Gender:Male
  • Location:Toulouse
  • Interests:Webmapping, thematical mapping.
  • France

As its in text format, you can use regular expressions to isolate the lines containing the notes, to produce a text file usable as atttributes.

#11
AndyM

AndyM

    Key Contributor

  • Validated Member
  • PipPipPip
  • 57 posts
  • Location:Ottawa
  • Canada

As its in text format, you can use regular expressions to isolate the lines containing the notes, to produce a text file usable as atttributes.


Regular expressions are powerful but if you don't use them often there's always a re-learning curve. The quick-and-dirty way might be to just sort the lines in a text editor, copy/paste the lines starting with "%AI3_Note" (or whatever) into a spreadsheet, split into columns (Data>Text to Columns), delete unwanted colums, and save as dbf or txt or whatever you need.

#12
Dennis McClendon

Dennis McClendon

    Hall of Fame

  • Validated Member
  • PipPipPipPipPipPipPip
  • 1,084 posts
  • Gender:Male
  • Location:Chicago
  • Interests:map design, large-scale maps of cities
  • United States

Alas, what seems to be missing is any link between the attribute notes (in the comment line) and the object itself. So sorting out the lines with notes will just give you a list of streetnames, I think.

My understanding of PostScript and Illustrator code is hazy at best, but 15 years ago Ole Kvern's books on FreeHand included a rudimentary understanding because you could easily include custom PostScript in FH files. My understanding is that various definitions at the beginning of the file set up single-letter short forms for common PostScript operators such as moveto and lineto and stroke. Then each object is described using x,y coordinates. However, it's not clear to me that each object in the file has any sort of record number to which attributes can be attached.

%AI3_Note:#92079#,#23300590#,#MARKT (MERKSPLAS)# <-- comment line
1567.0254 1459.3936 m <-- moveto command
1577.9707 1458.04 l <-- lineto command
S <-- stroke command
Dennis McClendon, Chicago CartoGraphics
chicagocarto.com

#13
Michael Schmeling

Michael Schmeling

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 206 posts
  • Gender:Male
  • Location:Kassel, Germany
  • Germany

Well, I don't quite understand why you would go to such lengths as parsing the .ai file if you could simply access the notes with an Illustrator script. Why not try that?

I think it should be possible to do something with a script.

The PathItem has a property 'note'. You could read it and write it to an ASCII file, for example.


Michael Schmeling
Kassel, Germany
Arid Ocean Map Illustrations
http://maps.aridocean.com
Indie Cartographer
http://www.indiecartographer.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->