Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-10-22 Thread Hans Hagen via ntg-context

On 10/22/2021 4:16 PM, Henning Hraban Ramm via ntg-context wrote:



Am 22.10.2021 um 11:31 schrieb Henning Hraban Ramm via ntg-context 
:



Am 17.07.2021 um 12:45 schrieb Hans Hagen :


\startMPpage
   draw lmt_openstreetmap [
   filename = "hasselt.osm"
   grid = "dots",
   ] ;
\stopMPpage

The hasselt osm file is sime 12 MB, the colorful hasselt pdf file just below 1 
MB so that's okay (3.7 sec processing time on my machine so if all claims are 
right sub seconds on a fast new apple).


I finally tried this, hoping to replace my Maperitive workflow.

With a Bonn map from https://download.bbbike.org/osm/bbbike/ of 724 MB I 
started it last night (~13 h before), and it still didn’t finish. No messages 
after:

openstreetmap   > processing file '/Users/hraban/Downloads/ConTeXt/Bonn.osm'
openstreetmap   > original size 713811948 bytes, stripped down to 603309215 
bytes


Maybe I should try smaller files ;)


Indeed:

openstreetmap   > processing file '/Users/hraban/Downloads/ConTeXt/Limburg.osm'
openstreetmap   > original size 12431810 bytes, stripped down to 8768209 bytes
openstreetmap   > xml data loaded
openstreetmap   > 859154 characters metapost code, preprocessing time 3.165 
seconds
...
pdfview | command: open "osm-test.pdf" 1>/dev/null 2>/dev/null &
mtx-context | pdfview overhead: 0.005 seconds
system  | total runtime: 9.211 seconds of 9.328 seconds

The PDF is 488 kB.


Redefining color works, if you know what you’re looking for – and it’s partly 
really strange what is marked how...
Seems like I should start to work on OSM again.


yes, and we need to add more heuristics (i already added some after 
rendering don knuths university site (apart from the many fast food 
venue research institutes are also marked 'interestingly')



Are there any plans for text labels, e.g. street names? (I guess these are 
really tricky.)

depends on how

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-10-22 Thread Henning Hraban Ramm via ntg-context

> Am 22.10.2021 um 11:31 schrieb Henning Hraban Ramm via ntg-context 
> :
> 
> 
>> Am 17.07.2021 um 12:45 schrieb Hans Hagen :
>> 
>> 
>> \startMPpage
>>   draw lmt_openstreetmap [
>>   filename = "hasselt.osm"
>>   grid = "dots",
>>   ] ;
>> \stopMPpage
>> 
>> The hasselt osm file is sime 12 MB, the colorful hasselt pdf file just below 
>> 1 MB so that's okay (3.7 sec processing time on my machine so if all claims 
>> are right sub seconds on a fast new apple).
> 
> I finally tried this, hoping to replace my Maperitive workflow.
> 
> With a Bonn map from https://download.bbbike.org/osm/bbbike/ of 724 MB I 
> started it last night (~13 h before), and it still didn’t finish. No messages 
> after:
> 
> openstreetmap   > processing file '/Users/hraban/Downloads/ConTeXt/Bonn.osm'
> openstreetmap   > original size 713811948 bytes, stripped down to 603309215 
> bytes
> 
> 
> Maybe I should try smaller files ;)

Indeed:

openstreetmap   > processing file '/Users/hraban/Downloads/ConTeXt/Limburg.osm'
openstreetmap   > original size 12431810 bytes, stripped down to 8768209 bytes
openstreetmap   > xml data loaded
openstreetmap   > 859154 characters metapost code, preprocessing time 3.165 
seconds
...
pdfview | command: open "osm-test.pdf" 1>/dev/null 2>/dev/null &
mtx-context | pdfview overhead: 0.005 seconds
system  | total runtime: 9.211 seconds of 9.328 seconds

The PDF is 488 kB.


Redefining color works, if you know what you’re looking for – and it’s partly 
really strange what is marked how...
Seems like I should start to work on OSM again.

Are there any plans for text labels, e.g. street names? (I guess these are 
really tricky.)

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-10-22 Thread Hans Hagen via ntg-context

On 10/22/2021 11:31 AM, Henning Hraban Ramm via ntg-context wrote:



Am 17.07.2021 um 12:45 schrieb Hans Hagen :


\startMPpage
draw lmt_openstreetmap [
filename = "hasselt.osm"
grid = "dots",
] ;
\stopMPpage

The hasselt osm file is sime 12 MB, the colorful hasselt pdf file just below 1 
MB so that's okay (3.7 sec processing time on my machine so if all claims are 
right sub seconds on a fast new apple).


I finally tried this, hoping to replace my Maperitive workflow.

With a Bonn map from https://download.bbbike.org/osm/bbbike/ of 724 MB I 
started it last night (~13 h before), and it still didn’t finish. No messages 
after:

openstreetmap   > processing file '/Users/hraban/Downloads/ConTeXt/Bonn.osm'
openstreetmap   > original size 713811948 bytes, stripped down to 603309215 
bytes

Maybe I should try smaller files ;)


We hit a limti in lpeg that allocates memory by duplicating the size 
which then hits a top and falls back in allocating by + 1 every capture 
which then kind of stalls the xml interpretation. I can hack that to 
work (and need to check that with every lpeg update), but as we enter a 
next stage in th econversion mem starts going virtual anyway and I see 
my SSD being tortured so I aborted. More testing has to wait till I (if 
ever) have a faster machine, with (say) 64GB super fast memory.


On my machine the still ok size is some 200MB.

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-10-22 Thread Henning Hraban Ramm via ntg-context

> Am 17.07.2021 um 12:45 schrieb Hans Hagen :
> 
> 
> \startMPpage
>draw lmt_openstreetmap [
>filename = "hasselt.osm"
>grid = "dots",
>] ;
> \stopMPpage
> 
> The hasselt osm file is sime 12 MB, the colorful hasselt pdf file just below 
> 1 MB so that's okay (3.7 sec processing time on my machine so if all claims 
> are right sub seconds on a fast new apple).

I finally tried this, hoping to replace my Maperitive workflow.

With a Bonn map from https://download.bbbike.org/osm/bbbike/ of 724 MB I 
started it last night (~13 h before), and it still didn’t finish. No messages 
after:

openstreetmap   > processing file '/Users/hraban/Downloads/ConTeXt/Bonn.osm'
openstreetmap   > original size 713811948 bytes, stripped down to 603309215 
bytes


Maybe I should try smaller files ;)


Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-27 Thread Alan Braslau via ntg-context

On 27/07/21 08:12, Gavin via ntg-context wrote:

Hi All,

Getting Closer I asked:


2) While I’m having good luck with paths, colors are causing trouble. In the 
data set the color information is in strings with French names of the color, 
like “rouge.” If I hand this string to MetaPost, MetaPost doesn’t expand it 
into a color. It does work if it is a native color, like “red,” but not if it 
is a defined color and not if the color is in a Lua variable. Any suggestions?


Aditya suggested:


\definecolor[rouge][red] should work. A better option will be use color 
palettes.


This solves my problem of translating French colors into English, but not the 
problem of passing colors from Lua to MetaPost. If the string giving the color 
name is in a variable, it doesn’t go through. A path in a variable works.

I’ve reduced my MWE below – no French, no MPinclusions, no new colors. Both pie 
slices should be red, but one is black. Any ideas on getting the color “red” 
passed from Lua to MetaPost when mycolor=“red”?


I am not looking closely at the code, but in general we use

fill fullcircle scaled 1cm withcolor red ;

and this takes Metapost's knowledge of red, the rgb triplet (1,0,0).
One can also use

fill fullcircle scaled 1cm withcolor "red" ;

as a string (quotation) and this passes Context's definition of the color.

Alan



--
Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-27 Thread Gavin via ntg-context
Hi All,

Getting Closer I asked:

>> 2) While I’m having good luck with paths, colors are causing trouble. In the 
>> data set the color information is in strings with French names of the color, 
>> like “rouge.” If I hand this string to MetaPost, MetaPost doesn’t expand it 
>> into a color. It does work if it is a native color, like “red,” but not if 
>> it is a defined color and not if the color is in a Lua variable. Any 
>> suggestions?

Aditya suggested:

> \definecolor[rouge][red] should work. A better option will be use color 
> palettes. 

This solves my problem of translating French colors into English, but not the 
problem of passing colors from Lua to MetaPost. If the string giving the color 
name is in a variable, it doesn’t go through. A path in a variable works.

I’ve reduced my MWE below – no French, no MPinclusions, no new colors. Both pie 
slices should be red, but one is black. Any ideas on getting the color “red” 
passed from Lua to MetaPost when mycolor=“red”?

Thanks!
Gavin


\startluacode
  mypath = {{0,0}, {2,0,0,0,2,0.5}, {1.6,1.2,1.9,0.8}, cycle = true}
  mycolor = “red”   --% Data files are read by Lua, so the color of each 
object will be a string, like "red".
  
  function mp.getpath() --% Is there a way for the MetaPost code to grab the 
path directly from the table?
mp.inject.path(mypath)
  end
  
  function mp.getred() --% Returning a string works.
mp.inject.string("red")
  end

  function mp.getcolor() --% Putting the string in a variable does not work.
mp.inject.string(mycolor)
  end
\stopluacode

\starttext
  \startMPpage
   fill lua.mp.getpath() scaled 2.5cm withcolor lua.mp.getred(); % Returning a 
string works.
   fill lua.mp.getpath() scaled 2.5cm shifted (0, -4cm) withcolor 
lua.mp.getcolor(); % Putting the string in a variable does not work.
  \stopMPpage
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-26 Thread Aditya Mahajan via ntg-context
On Mon, 26 Jul 2021, Gavin via ntg-context wrote:

> 2) While I’m having good luck with paths, colors are causing trouble. In the 
> data set the color information is in strings with French names of the color, 
> like “rouge.” If I hand this string to MetaPost, MetaPost doesn’t expand it 
> into a color. It does work if it is a native color, like “red,” but not if it 
> is a defined color and not if the color is in a Lua variable. Any suggestions?

\definecolor[rouge][red] should work. A better option will be use color 
palettes. 

This is very old code, but will give an idea of how to use palettes:
https://github.com/adityam/visualcounter/blob/master/visualcounter.pdf 
Effectively all you need to do is add \setuppalet[name] at an appropriate 
place, and then the user can easily change the colors (rather than having them 
specified as part of data files).

Aditya___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-26 Thread Gavin via ntg-context
Hi everyone,

I’ve made great progress creating globes for my diagrams using the data in the 
mp-geo package and some ideas from Hans. I have a couple questions about moving 
information from Lua to MetaPost. Below is a MWE for illustration. I have two 
related questions:

1) Is there a way for MetaPost to grab information from a Lua table? Currently 
the MetaPost code calls a Lua function which has a single line returning the 
information from the table. Is this necessary, or is these something in 
MetaPost that can get a path or color from a Lua table? 

2) While I’m having good luck with paths, colors are causing trouble. In the 
data set the color information is in strings with French names of the color, 
like “rouge.” If I hand this string to MetaPost, MetaPost doesn’t expand it 
into a color. It does work if it is a native color, like “red,” but not if it 
is a defined color and not if the color is in a Lua variable. Any suggestions?

Thanks!
Gavin


The code below produces four pie shape wedges to show the different results of 
handling the color. They should all be red, but the last two are black.


\startMPinclusions
  color rouge;  % To avoid changing the data files, I need to define 
colors in French.
  rouge=(1,0,0);% For this MWE, I only define rouge.
  
  color mycolor;% Defining mycolor in MetaPost works great, as shown in 
the first shape.
  mycolor = rouge;
\stopMPinclusions

\startluacode
  myluapath = {{0,0}, {1,0,0,0,1,0.25}, {0.8,0.6,0.95,0.4}, cycle = true}
  myluacolor = “red”--% Data files are read by Lua, so the myluacolor will 
be a string (in French, but native colors don't work either).
  
  function mp.getpath() --% Is there a way for the MetaPost code to grab the 
path directly from the table?
mp.inject.path(myluapath)
  end
  
  function mp.getred() --% Returning a string work for native colors.
mp.inject.string("red")
  end

  function mp.getrouge() --% Returning a string does not work for defined
mp.inject.string("rouge")
  end

  function mp.getcolor() --% Putting the string in a variable does not work.
mp.inject.string(mycolor)
  end
\stopluacode

\starttext
  \startMPpage
   fill lua.mp.getpath() scaled 2.5cm withcolor mycolor; % MetaPost color 
definition works great.
   fill lua.mp.getpath() scaled 2.5cm shifted (0, -2cm) withcolor 
lua.mp.getred(); % Returning a string work for native colors.
   fill lua.mp.getpath() scaled 2.5cm shifted (0, -4cm) withcolor 
lua.mp.getrouge(); % Returning a string does not work for defined colors.
   fill lua.mp.getpath() scaled 2.5cm shifted (0, -6cm) withcolor 
lua.mp.getcolor(); % Putting the string in a variable does not work.
  \stopMPpage
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-18 Thread Henning Hraban Ramm

> Am 17.07.2021 um 20:50 schrieb Hans Hagen :
> 
> On 7/17/2021 2:42 PM, Arthur Rosendahl wrote:
>> On Sat, Jul 17, 2021 at 12:53:33PM +0200, Hans Hagen wrote:
>>> Just as an example, the context meeting is att the attached location:
>>> 
>>>   50°45’7” / 5°35’19”
>>> 
>>> https://www.openstreetmap.org/export#map=18/50.75175/5.58883
>>   If you want official data you can try the Belgian cadastre:
>> https://data.gov.be/en/dataset/tt098dcb-f5c7-49b8-8e0b-7c3811630d85 :-)
> Yet another format? No way. I managed to go big so for instance the area 
> where the colorado user group is located:
> 
>  https://www.openstreetmap.org/export#map=12/40.5117/-104.9496
> 
> produces a 122 MB osm file
> 
>  https://overpass-api.de/api/map?bbox=-105.1817,40.4096,-104.9493,40.6272
> 
> that gets turned into a 15 MB metapost file that becomes an 8.7 MB pdf file. 
> Unfortunately it takes 36 seconds to be produced (9 seconds xml loading, 17 
> seconds map processing, 3 seconds mp -- which is not that bad -- and some 
> 2.56 seconds pdf production) plus some 3 GB memory but that's still under my 
> limit. Maybe a decent modern desktop can do it in half that time, who knows.
> 
> Of course the rather detailed colorfull image is a challenge for the pdf 
> viewer but (sumatra) it manages and one can then zoom in a lot. I tried the 
> whole of slovenia to prove myself to mojca but overran my quota for that api 
> (and I'm not in the mood to install all kind of stuff here).

I downloaded a few countries for you:
https://sedna.fiee.net/d/328d53f6a3e04b23aee2/

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-17 Thread Hans Hagen

On 7/17/2021 2:42 PM, Arthur Rosendahl wrote:

On Sat, Jul 17, 2021 at 12:53:33PM +0200, Hans Hagen wrote:

Just as an example, the context meeting is att the attached location:

   50°45’7” / 5°35’19”

https://www.openstreetmap.org/export#map=18/50.75175/5.58883


   If you want official data you can try the Belgian cadastre:
https://data.gov.be/en/dataset/tt098dcb-f5c7-49b8-8e0b-7c3811630d85 :-)
Yet another format? No way. I managed to go big so for instance the area 
where the colorado user group is located:


  https://www.openstreetmap.org/export#map=12/40.5117/-104.9496

produces a 122 MB osm file

  https://overpass-api.de/api/map?bbox=-105.1817,40.4096,-104.9493,40.6272

that gets turned into a 15 MB metapost file that becomes an 8.7 MB pdf 
file. Unfortunately it takes 36 seconds to be produced (9 seconds xml 
loading, 17 seconds map processing, 3 seconds mp -- which is not that 
bad -- and some 2.56 seconds pdf production) plus some 3 GB memory but 
that's still under my limit. Maybe a decent modern desktop can do it in 
half that time, who knows.


Of course the rather detailed colorfull image is a challenge for the pdf 
viewer but (sumatra) it manages and one can then zoom in a lot. I tried 
the whole of slovenia to prove myself to mojca but overran my quota for 
that api (and I'm not in the mood to install all kind of stuff here).


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-17 Thread Arthur Rosendahl
On Sat, Jul 17, 2021 at 12:53:33PM +0200, Hans Hagen wrote:
> Just as an example, the context meeting is att the attached location:
> 
>   50°45’7” / 5°35’19”
> 
> https://www.openstreetmap.org/export#map=18/50.75175/5.58883

  If you want official data you can try the Belgian cadastre:
https://data.gov.be/en/dataset/tt098dcb-f5c7-49b8-8e0b-7c3811630d85 :-)

Best,

Arthur
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-17 Thread Henning Hraban Ramm

> Am 17.07.2021 um 12:45 schrieb Hans Hagen :
> 
> On 7/17/2021 12:20 PM, Henning Hraban Ramm wrote:
>>> Am 17.07.2021 um 11:53 schrieb Bruce Horrocks :
>>> 
>>> 
>>> 
 On 16 Jul 2021, at 20:55, Hans Hagen  wrote:
 
 On 7/15/2021 10:30 PM, Bruce Horrocks wrote:
> On 15 Jul 2021, at 18:58, Hans Hagen  wrote:
>> 
>> I was wondering about that too. I admit that I looked into maps years 
>> ago but never could find quality data files.
> Does this help?
> 
 i was halfway writing as reader for that fiel format when i noticed that 
 is is also quite low res so i gave up on that and started playing 
 (extending) with an more interesting alternative that mojca and i wrote 
 years ago at a meeting
>>> 
>>> Off the top of my head I'm not aware of any higher resolution sources of 
>>> global data - what scale were you thinking of?
>> Can you work with OpenStreetMap data?
>> https://planet.openstreetmap.org
>> http://download.geofabrik.de
>> https://download.bbbike.org/osm/
>> I didn’t find excerpts that only have e.g. country borders or rivers. But 
>> with usual XML tools you could extract those.
> Indeed, that is what I was referring too. Mojca found this:
>  https://osm-boundaries.com/

Ah, our mails crossed...

> At a bachotex meeting (years ago, when the ctx group donated a nice roadmap 
> display to the conference) we made an openstreetmap -> metapost style but 
> afaik that never made it into a module. So, when I remembered that I updated 
> it. I can now render my hometown (need to figure out colors) quite okay. (One 
> can export an osm file in openstreetmap but with some limitations on size.)
> 
> I have to play a bit more with the style before I define it useable but the 
> interface is liek this:
> 
> % where i live
> 
> \startMPpage
>draw lmt_openstreetmap [
>filename = "hasselt.osm"
>grid = "dots",
>] ;
> \stopMPpage
> 
> % island in paris
> 
> \startMPpage
>draw lmt_openstreetmap [
>filename = "e:/tmp/map.osm"
>] ;
> \stopMPpage
> 
> The hasselt osm file is sime 12 MB, the colorful hasselt pdf file just below 
> 1 MB so that's okay (3.7 sec processing time on my machine so if all claims 
> are right sub seconds on a fast new apple).
> 
> Of course I need to make colors and what gets rendered configurable (via the 
> interface). It's more about the fun aspect .. no need to typeset complete 
> routes because that's what the web is for.

For our architectural guides I make maps with OSM data and Maperitive. It’s a 
PITA (sooo slow with Mono on OSX and hadly documented), but works.
Maperitive uses "mrules" style files (example attached).

[call]

mono --desktop Maperitive/Maperitive.Console.exe -defaultscript=false 
../baukultur.mscript
inkscape -z -f citymap.svgz -A citymap.pdf


[baukultur.mscript]

set-setting name=map.decoration.attribution value=false
set-setting name=map.decoration.grid value=false
set-setting name=map.decoration.scale value=false
set-setting name=map.rendering.font-family value="AlegreyaSans"

use-ruleset location=Maperitive/Rules/baukultur.mrules
// load some additional data, e.g. markers
load-source archiguide.osm
// exported OSM city map
load-source bonn.osm

// Stadthalle BG
move-pos y=50.68064 x=7.15849 zoom=17
set-home
set-geo-bounds 7.153,50.6840,7.162,50.6772
set-print-bounds-geo 7.153,50.6840,7.162,50.6772
export-svg file=citymap.svgz compatibility=inkscape map-scale=5000


Hraban




baukultur.mrules
Description: Binary data



___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-17 Thread Hans Hagen

Hi,

Just as an example, the context meeting is att the attached location:

  50°45’7” / 5°35’19”

https://www.openstreetmap.org/export#map=18/50.75175/5.58883

(Okay, I need to use a railway track dash pattern "railway".)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-


m-openstreetmap.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-17 Thread Henning Hraban Ramm

> Am 17.07.2021 um 12:20 schrieb Henning Hraban Ramm :
> 
>> 
>> Am 17.07.2021 um 11:53 schrieb Bruce Horrocks :
>> 
>> 
>> 
>>> On 16 Jul 2021, at 20:55, Hans Hagen  wrote:
>>> 
>>> On 7/15/2021 10:30 PM, Bruce Horrocks wrote:
 On 15 Jul 2021, at 18:58, Hans Hagen  wrote:
> 
> I was wondering about that too. I admit that I looked into maps years ago 
> but never could find quality data files.
 Does this help?
 
>>> i was halfway writing as reader for that fiel format when i noticed that is 
>>> is also quite low res so i gave up on that and started playing (extending) 
>>> with an more interesting alternative that mojca and i wrote years ago at a 
>>> meeting
>> 
>> Off the top of my head I'm not aware of any higher resolution sources of 
>> global data - what scale were you thinking of?
> 
> Can you work with OpenStreetMap data?
> 
> https://planet.openstreetmap.org
> http://download.geofabrik.de
> https://download.bbbike.org/osm/
> 
> I didn’t find excerpts that only have e.g. country borders or rivers. But 
> with usual XML tools you could extract those.

There’s https://osm-boundaries.com, but it doesn’t really work (for me).

You should also be able to select elements via Overpass API, but it doesn’t 
work reliably for me at http://overpass-turbo.eu

This is the query for mainland Netherlands:
curl --remote-name --remote-header-name --location --max-redirs -1 
"https://osm-boundaries.com/Download/Submit?db=osm20210531=-2323309,-1216720=GeoJSON=4326=1;

You also need an API key that depends on your OSM account. Result attached.

Hraban



OSMB-dcc52d93616707aa0f6d582c82816ed1034354d6.geojson.gz
Description: GNU Zip compressed data
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-17 Thread Hans Hagen

On 7/17/2021 12:20 PM, Henning Hraban Ramm wrote:



Am 17.07.2021 um 11:53 schrieb Bruce Horrocks :




On 16 Jul 2021, at 20:55, Hans Hagen  wrote:

On 7/15/2021 10:30 PM, Bruce Horrocks wrote:

On 15 Jul 2021, at 18:58, Hans Hagen  wrote:


I was wondering about that too. I admit that I looked into maps years ago but 
never could find quality data files.

Does this help?


i was halfway writing as reader for that fiel format when i noticed that is is 
also quite low res so i gave up on that and started playing (extending) with an 
more interesting alternative that mojca and i wrote years ago at a meeting


Off the top of my head I'm not aware of any higher resolution sources of global 
data - what scale were you thinking of?


Can you work with OpenStreetMap data?

https://planet.openstreetmap.org
http://download.geofabrik.de
https://download.bbbike.org/osm/

I didn’t find excerpts that only have e.g. country borders or rivers. But with 
usual XML tools you could extract those.

Indeed, that is what I was referring too. Mojca found this:

  https://osm-boundaries.com/

At a bachotex meeting (years ago, when the ctx group donated a nice 
roadmap display to the conference) we made an openstreetmap -> metapost 
style but afaik that never made it into a module. So, when I remembered 
that I updated it. I can now render my hometown (need to figure out 
colors) quite okay. (One can export an osm file in openstreetmap but 
with some limitations on size.)


I have to play a bit more with the style before I define it useable but 
the interface is liek this:


% where i live

\startMPpage
draw lmt_openstreetmap [
filename = "hasselt.osm"
grid = "dots",
] ;
\stopMPpage

% island in paris

\startMPpage
draw lmt_openstreetmap [
filename = "e:/tmp/map.osm"
] ;
\stopMPpage

The hasselt osm file is sime 12 MB, the colorful hasselt pdf file just 
below 1 MB so that's okay (3.7 sec processing time on my machine so if 
all claims are right sub seconds on a fast new apple).


Of course I need to make colors and what gets rendered configurable (via 
the interface). It's more about the fun aspect .. no need to typeset 
complete routes because that's what the web is for.


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-17 Thread Henning Hraban Ramm

> Am 17.07.2021 um 11:53 schrieb Bruce Horrocks :
> 
> 
> 
>> On 16 Jul 2021, at 20:55, Hans Hagen  wrote:
>> 
>> On 7/15/2021 10:30 PM, Bruce Horrocks wrote:
>>> On 15 Jul 2021, at 18:58, Hans Hagen  wrote:
 
 I was wondering about that too. I admit that I looked into maps years ago 
 but never could find quality data files.
>>> Does this help?
>>> 
>> i was halfway writing as reader for that fiel format when i noticed that is 
>> is also quite low res so i gave up on that and started playing (extending) 
>> with an more interesting alternative that mojca and i wrote years ago at a 
>> meeting
> 
> Off the top of my head I'm not aware of any higher resolution sources of 
> global data - what scale were you thinking of?

Can you work with OpenStreetMap data?

https://planet.openstreetmap.org
http://download.geofabrik.de
https://download.bbbike.org/osm/

I didn’t find excerpts that only have e.g. country borders or rivers. But with 
usual XML tools you could extract those.

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-17 Thread Bruce Horrocks


> On 16 Jul 2021, at 20:55, Hans Hagen  wrote:
> 
> On 7/15/2021 10:30 PM, Bruce Horrocks wrote:
>> On 15 Jul 2021, at 18:58, Hans Hagen  wrote:
>>> 
>>> I was wondering about that too. I admit that I looked into maps years ago 
>>> but never could find quality data files.
>> Does this help?
>> 
> i was halfway writing as reader for that fiel format when i noticed that is 
> is also quite low res so i gave up on that and started playing (extending) 
> with an more interesting alternative that mojca and i wrote years ago at a 
> meeting

Off the top of my head I'm not aware of any higher resolution sources of global 
data - what scale were you thinking of?

For the UK there are free maps down to street level, either as a single file or 
API. The API details are here:


The license allows free use for apps made available to the public.

—
Bruce Horrocks
Hampshire, UK

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-16 Thread Alan Braslau

On 16/07/21 21:51, Hans Hagen wrote:

On 7/16/2021 4:53 PM, Gavin Polhemus wrote:

P.S. I marked the location of our local ConTeXt users group on the 
map, in case any of you want to visit.
1/3rd of your user group fled the country and is way closer by where i 
live now,


And in the same time zone!

--
Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-16 Thread Hans Hagen

On 7/15/2021 10:30 PM, Bruce Horrocks wrote:

On 15 Jul 2021, at 18:58, Hans Hagen  wrote:


I was wondering about that too. I admit that I looked into maps years ago but 
never could find quality data files.


Does this help?

i was halfway writing as reader for that fiel format when i noticed that 
is is also quite low res so i gave up on that and started playing 
(extending) with an more interesting alternative that mojca and i wrote 
years ago at a meeting


Hans




-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-16 Thread Hans Hagen

On 7/16/2021 4:53 PM, Gavin Polhemus wrote:


P.S. I marked the location of our local ConTeXt users group on the map, in case 
any of you want to visit.
1/3rd of your user group fled the country and is way closer by where i 
live now,


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-16 Thread Gavin
Hi Hans, Aditya, and all,

Me:
 I’d like to use the mp-geo Metapost package with ConTeXt to draw simple
>>> globes viewed from various directions. The package is here:
 
https://melusine.eu.org/syracuse/poulecl/mp-geo/ 
 

Aditya:
>> Actually the data files are fairly simple:
>> no_of_points
>> 
>> So, it would be much simpler to read and parse it via lua rather than 
>> scantokens. Rest of the code simply determines a "view" of what to show. So, 
>> it can be a good exercise in lua-MP interface.

Hans:
> I was wondering about that too. I admit that I looked into maps years ago but 
> never could find quality data files.

This is great fun! I slightly altered Hans’ code to produce the most basic area 
preserving projection of North America (code and map below). If anyone else is 
playing with the mp-geo data, it is in arc minutes, so divide by 60 to get 
degrees.

For my book I only want 5cm diameter globes with continents, so the map data in 
the mp-geo package is far more detailed than I need. The code is so fast, the 
detail doesn’t seem to be a problem.

I just started learning Metapost a month ago, and it’s great. I know almost 
nothing about Lua, but this looks like a fun project for learning more!

Thanks!
Gavin


P.S. I marked the location of our local ConTeXt users group on the map, in case 
any of you want to visit.


\starttext

\startluacode
  function mp.maptopath(filename)
  local t = { cycle = true }
  for phi, theta in 
string.gmatch(io.loaddata(filename),"%(([%+%-%d]+),([%+%-%d]+)%)") do
  t[#t+1] = { math.cosd(tonumber(phi)/60)*tonumber(theta+6125)/12, 
tonumber(phi)/12 }
  end
  mp.inject.path(t)
  end
\stopluacode

\startMPpage
  fill lua.mp.maptopath("data/usa1.dat");
  fill lua.mp.maptopath("data/usa2.dat") ;
  fill lua.mp.maptopath("data/mexique.dat") ;
  fill lua.mp.maptopath("data/canada.dat") ;
  fill fullcircle scaled 5 shifted (0, 203) withcolor white;
\stopMPpage

\stoptext




___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-15 Thread Bruce Horrocks
On 15 Jul 2021, at 18:58, Hans Hagen  wrote:
> 
> I was wondering about that too. I admit that I looked into maps years ago but 
> never could find quality data files.

Does this help?


—
Bruce Horrocks
Hampshire, UK

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-15 Thread Hans Hagen

On 7/15/2021 6:22 PM, Aditya Mahajan wrote:

On Thu, 15 Jul 2021, Hans Hagen wrote:


On 7/14/2021 4:43 PM, Gavin wrote:

Hello ConTeXters,

I’d like to use the mp-geo Metapost package with ConTeXt to draw simple

globes viewed from various directions. The package is here:


https://melusine.eu.org/syracuse/poulecl/mp-geo/

It looks like the last update was 2008 and I don’t read French, so I though

my chances of getting anything to work were pretty small. However, I was
pleasantly surprised that this MWE found the mp-geo package, the necessary
Metapost files in the ConTeXt installation, and the data files.


\starttext
\startMPcode
input mp-geo;
figure(-10u,-10u,10u,10u);
Mercator(3,48,30);
fin;
end
\stopMPcode
\stoptext

While all of the files were found, it did not produce a globe. Instead I got

an error complaining about an invalid character in the data files. This error
is repeated for about 20 files (a small fraction of the total). I put the
first error and its data file below. All the others are identical with
different .dat files.


Maybe it’s just an encoding mismatch or a hidden character I can easily

delete or replace. On the other hand, maybe I shouldn't even be attempting
this? 2008 is a long time ago in ConTeXt time. Feel free to tell me this
project is crazy, but if you have an idea how I can make this work, I’d really
appreciate it! It looks like a fun package.
Looks interesting (I didn't know about it, also the surface stuff).
Anyway, the message relates to scantokens not liking what gets read from
a file, quite probably a missing file (I'll make it return a different
message but still one needs to be aware of the fact that fiel reading in
mp is kind of weird so it really expects a file).


Actually the data files are fairly simple:

no_of_points


So, it would be much simpler to read and parse it via lua rather than scantokens. Rest of 
the code simply determines a "view" of what to show. So, it can be a good 
exercise in lua-MP interface.


I was wondering about that too. I admit that I looked into maps years 
ago but never could find quality data files.


\starttext

\startluacode
function mp.maptopath(filename)
local t = { cycle = true }
for x, y in 
string.gmatch(io.loaddata(filename),"%(([%+%-%d]+),([%+%-%d]+)%)") do

t[#t+1] = { tonumber(x), tonumber(y) }
end
mp.inject.path(t)
end
\stopluacode

\startMPpage
draw lua.mp.maptopath("slovenia.dat") ;
\stopMPpage

\startMPpage
draw lua.mp.maptopath("usa1.dat") rotated 90 ;
\stopMPpage

\startMPpage
draw lua.mp.maptopath("usa2.dat") ;
\stopMPpage

\stoptext

way to low quality ... we also want multiple shapes i guess .. i wonder 
if someone knows where to get good free data


(projections are more your turf)

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-15 Thread Aditya Mahajan
On Thu, 15 Jul 2021, Hans Hagen wrote:

> On 7/14/2021 4:43 PM, Gavin wrote:
> > Hello ConTeXters,
> > 
> > I’d like to use the mp-geo Metapost package with ConTeXt to draw simple
> globes viewed from various directions. The package is here:
> > 
> > https://melusine.eu.org/syracuse/poulecl/mp-geo/
> > 
> > It looks like the last update was 2008 and I don’t read French, so I though
> my chances of getting anything to work were pretty small. However, I was
> pleasantly surprised that this MWE found the mp-geo package, the necessary
> Metapost files in the ConTeXt installation, and the data files.
> > 
> > \starttext
> > \startMPcode
> > input mp-geo;
> > figure(-10u,-10u,10u,10u);
> > Mercator(3,48,30);
> > fin;
> > end
> > \stopMPcode
> > \stoptext
> > 
> > While all of the files were found, it did not produce a globe. Instead I got
> an error complaining about an invalid character in the data files. This error
> is repeated for about 20 files (a small fraction of the total). I put the
> first error and its data file below. All the others are identical with
> different .dat files.
> > 
> > Maybe it’s just an encoding mismatch or a hidden character I can easily
> delete or replace. On the other hand, maybe I shouldn't even be attempting
> this? 2008 is a long time ago in ConTeXt time. Feel free to tell me this
> project is crazy, but if you have an idea how I can make this work, I’d really
> appreciate it! It looks like a fun package.
> Looks interesting (I didn't know about it, also the surface stuff). 
> Anyway, the message relates to scantokens not liking what gets read from 
> a file, quite probably a missing file (I'll make it return a different 
> message but still one needs to be aware of the fact that fiel reading in 
> mp is kind of weird so it really expects a file).

Actually the data files are fairly simple: 

no_of_points


So, it would be much simpler to read and parse it via lua rather than 
scantokens. Rest of the code simply determines a "view" of what to show. So, it 
can be a good exercise in lua-MP interface.

Aditya___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-15 Thread Hans Hagen

On 7/14/2021 4:43 PM, Gavin wrote:

Hello ConTeXters,

I’d like to use the mp-geo Metapost package with ConTeXt to draw simple globes 
viewed from various directions. The package is here:

https://melusine.eu.org/syracuse/poulecl/mp-geo/

It looks like the last update was 2008 and I don’t read French, so I though my 
chances of getting anything to work were pretty small. However, I was 
pleasantly surprised that this MWE found the mp-geo package, the necessary 
Metapost files in the ConTeXt installation, and the data files.

\starttext
\startMPcode
input mp-geo;
figure(-10u,-10u,10u,10u);
Mercator(3,48,30);
fin;
end
\stopMPcode
\stoptext

While all of the files were found, it did not produce a globe. Instead I got an 
error complaining about an invalid character in the data files. This error is 
repeated for about 20 files (a small fraction of the total). I put the first 
error and its data file below. All the others are identical with different .dat 
files.

Maybe it’s just an encoding mismatch or a hidden character I can easily delete 
or replace. On the other hand, maybe I shouldn't even be attempting this? 2008 
is a long time ago in ConTeXt time. Feel free to tell me this project is crazy, 
but if you have an idea how I can make this work, I’d really appreciate it! It 
looks like a fun package.
Looks interesting (I didn't know about it, also the surface stuff). 
Anyway, the message relates to scantokens not liking what gets read from 
a file, quite probably a missing file (I'll make it return a different 
message but still one needs to be aware of the fact that fiel reading in 
mp is kind of weird so it really expects a file).


That said, there are some issues that you need to sort out: no btex/etex 
and no TEX command but textext instead. You could ask the authors.


There are indeed funny characters in the files but nothing your 
bilingual local context user group member Alan couldn't help you with (a 
good reason to visit him. My french is too rusty (even with some french 
music running in the background right now.)


If you can get that code running it makes a nice article.

Hans

PS. 2008 is not that old, many context commands date from the 90's


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] mp-geo Metapost package with ConTeXt

2021-07-14 Thread Gavin
Hello ConTeXters,

I’d like to use the mp-geo Metapost package with ConTeXt to draw simple globes 
viewed from various directions. The package is here:

https://melusine.eu.org/syracuse/poulecl/mp-geo/

It looks like the last update was 2008 and I don’t read French, so I though my 
chances of getting anything to work were pretty small. However, I was 
pleasantly surprised that this MWE found the mp-geo package, the necessary 
Metapost files in the ConTeXt installation, and the data files.

\starttext
\startMPcode
input mp-geo;
figure(-10u,-10u,10u,10u);
Mercator(3,48,30);
fin;
end
\stopMPcode
\stoptext

While all of the files were found, it did not produce a globe. Instead I got an 
error complaining about an invalid character in the data files. This error is 
repeated for about 20 files (a small fraction of the total). I put the first 
error and its data file below. All the others are identical with different .dat 
files.

Maybe it’s just an encoding mismatch or a hidden character I can easily delete 
or replace. On the other hand, maybe I shouldn't even be attempting this? 2008 
is a long time ago in ConTeXt time. Feel free to tell me this project is crazy, 
but if you have an idea how I can make this work, I’d really appreciate it! It 
looks like a fun package.

Thanks!
Gavin


Error Log: (This error log below is actually from running Metapost directly on 
just the .mp file with the metapost code above. This error log is slightly more 
clear in its formatting than the ConTeXt log, but contains the same 
information.)

! Text line contains an invalid character.
 ^^@

 
   ;
Lecture->...nblec:=scantokens.readfrom.NomFichier;
  for.w=1upto.nblec:if.proje...

Mercator->...((EXPR4));Lecture("Cameriquesud.dat")
  ;Lecture("Ccaraibes.dat");...
l.3 Mercator(3,48,30)
 ;
? 
! An expression can't begin with `;'.
 
0
 
   ;
Lecture->...nblec:=scantokens.readfrom.NomFichier;
  for.w=1upto.nblec:if.proje...

Mercator->...((EXPR4));Lecture("Cameriquesud.dat")
  ;Lecture("Ccaraibes.dat");...
l.3 Mercator(3,48,30)
 ;


Data file Cameriquesud.dat is pretty short:

16
arborescence&"bresil.dat",vert
arborescence&"uruguay.dat",jaune
arborescence&"paraguay.dat",jaune
arborescence&"bolivie1.dat",bleu
arborescence&"bolivie2.dat",bleu
arborescence&"argentine1.dat",rouge
arborescence&"argentine2.dat",rouge
arborescence&"chili1.dat",violet
arborescence&"chili2.dat",violet
arborescence&"guineef.dat",jaune
arborescence&"surinam.dat",rouge
arborescence&"guyane.dat",orange
arborescence&"venezuela.dat",bleu
arborescence&"colombie.dat",rouge
arborescence&"perou.dat",rose
arborescence&"equateur.dat",jaune

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___