Mapquest Mapnik Styles

404 views
Skip to first unread message

Beekay

unread,
Apr 13, 2011, 7:30:15 AM4/13/11
to Mapnik to GeoTools Style Conversion
Hi David,
I have compiled the Mapnik2GeoToolsProject. When I call run without
any parameters it appears to have no issues. However when I call run
and pass it one of the Mapquest Mapnik style files I downloaded from
here https://github.com/MapQuest/MapQuest-Mapnik-Style I have start to
get all kinds of issues. I was wondering if you have managed to
convert these style files to slds, if so can you send me a link to
them or tell me what I need to do to get the Mapnik2GeoToolsProject to
convert them to slds.
Thanks for your time and help
Blaithín

David Winslow

unread,
Apr 13, 2011, 8:29:54 AM4/13/11
to Beekay, Mapnik to GeoTools Style Conversion
Could you copy the errors you're getting to a file and send it to this mailing list?  It is difficult to troubleshoot without seeing the error report from the running code.

One easy way to get all the errors into a file is to run like this:

sbt "run ../MapQuest-Mapnik-Style/mapquest-us.xml " > run-log.txt

--
David Winslow

Beekay

unread,
Apr 13, 2011, 9:15:00 AM4/13/11
to Mapnik to GeoTools Style Conversion
Hi David,

So I ran the script the following is the content of the run-log.txt
file


C:\Simple_Build_Tool\mapnik2geotools>set SCRIPT_DIR=C:
\Simple_Build_Tool\mapnik2geotools\

C:\Simple_Build_Tool\mapnik2geotools>java -Xmx512M -jar "C:
\Simple_Build_Tool\mapnik2geotools\sbt-launch-0.7.5.jar" "run Mapquest-
Mapnik/mapquest-us.xml"
[info] Building project mn2gt 0.1 against Scala 2.8.0
[info] using Mapnik2GeoToolsProject with sbt 0.7.4 and Scala 2.7.7
[info]
[info] == compile ==
[info] Source analysis: 0 new/modified, 0 indirectly invalidated, 0
removed.
[info] Compiling main sources...
[info] Nothing to compile.
[info] Post-analysis: 138 classes.
[info] == compile ==
[info]
[info] == copy-resources ==
[info] == copy-resources ==
[info]
[info] == run ==
[info] Running Driver Mapquest-Mapnik/mapquest-us.xml
org.xml.sax.SAXParseException: The entity name must immediately follow
the '%' in the parameter entity reference.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanEntityValue(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanEntityDecl(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDInternalSubset(Unknown
Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl
$DTDDriver.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl
$DTDDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl
$PrologDriver.next(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
$JAXPSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at scala.xml.factory.XMLLoader$class.loadXML(XMLLoader.scala:40)
at scala.xml.XML$.loadXML(XML.scala:40)
at scala.xml.factory.XMLLoader$class.load(XMLLoader.scala:54)
at scala.xml.XML$.load(XML.scala:40)
at Driver$$anonfun$main$1.apply(Driver.scala:51)
at Driver$$anonfun$main$1.apply(Driver.scala:48)
at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:61)
at scala.collection.immutable.List.foreach(List.scala:45)
at Driver$.main(Driver.scala:48)
at Driver.main(Driver.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sbt.Run.run0(Run.scala:60)
at sbt.Run.execute$1(Run.scala:47)
at sbt.Run$$anonfun$run$2.apply(Run.scala:50)
at sbt.Run$$anonfun$run$2.apply(Run.scala:50)
at sbt.TrapExit$.executeMain$1(TrapExit.scala:33)
at sbt.TrapExit$$anon$1.run(TrapExit.scala:42)
[info] == run ==
[error] Error running run: Nonzero exit code: 1
[info]
[info] Total time: 1 s, completed 13-Apr-2011 13:58:26
[info]
[info] Total session time: 1 s, completed 13-Apr-2011 13:58:26
[error] Error during build.

I created copies of the template files I made minimal changes to the
settings.xml.inc I changed line 9 to this

<!ENTITY osm2pgsql_projection "&srs900913;">

I also download these files http://tile.openstreetmap.org/world_boundaries-spherical.tgz
and extracted them to a folder named world_boundaries which I put at
the same level in the folder structure as the file mapquest-us.xml. In
fontset-settings.xml.inc I removed the unifont entries, I didn't make
any change to the datasource-settings.xml.inc.template file as I have
no idea what I need to do to set the extent manually so I just saved a
copy as datasource-settings.xml.inc. I have never worked with any
environment like this before my background is as a developer using
using Visual Studio to write c,c++ and c# code to process and
visualise data so forgive me if I am missing something obvious here.
If you need any more information let me know.

Thanks for your help.
Blaithín

On Apr 13, 1:29 pm, David Winslow <dwins...@opengeo.org> wrote:
> Could you copy the errors you're getting to a file and send it to this
> mailing list?  It is difficult to troubleshoot without seeing the error
> report from the running code.
>
> One easy way to get all the errors into a file is to run like this:
>
> sbt "run ../MapQuest-Mapnik-Style/mapquest-us.xml " > run-log.txt
>
> --
> David Winslow
> OpenGeo -http://opengeo.org/
>
>
>
>
>
>
>
> On Wed, Apr 13, 2011 at 7:30 AM, Beekay <blaithin.kenn...@gmail.com> wrote:
> > Hi David,
> > I have compiled the Mapnik2GeoToolsProject. When I call run without
> > any parameters it appears to have no issues. However when I call run
> > and pass it one of the Mapquest Mapnik style files I downloaded from
> > herehttps://github.com/MapQuest/MapQuest-Mapnik-StyleI have start to

David Winslow

unread,
Apr 13, 2011, 9:44:45 AM4/13/11
to Beekay, Mapnik to GeoTools Style Conversion
This message from the stack trace:

The entity name must immediately follow the '%' in the parameter entity reference.

suggests to me that you have a syntax error somewhere in your XML (I guess one of the .inc files you copied from the templates included with the mapquest styles).  I'll attach the copies I use (the paths won't matter until you are importing into geoserver anyway.)

While verifying that these work I found that the latest styles from MapQuest use some mapnik options that aren't yet handled by mapnik2geotools.  To verify that things are working properly (well, as written anyway) I would recommend reverting the MapQuest styles to a version from before the last revision of mapnik2geotools (which was in February).  You can use git's command-line for that:

cd MapQuest-Mapnik-Style && git checkout master@{2011-02-15}

If you are interested in an IDE, the current best IDE for Scala development is IntelliJ IDEA - http://jetbrains.com/idea/ .

--
David Winslow
datasource-settings.xml.inc
fontset-settings.xml.inc
settings.xml.inc

Beekay

unread,
Apr 14, 2011, 7:01:54 AM4/14/11
to Mapnik to GeoTools Style Conversion
Hi David,

Thanks for getting back to me what is "git's command-line" and how to
I access it? Also is there any chance you could just send me the slds?

Blaithín

On Apr 13, 2:44 pm, David Winslow <dwins...@opengeo.org> wrote:
> This message from the stack trace:
>
> The entity name must immediately follow the '%' in the parameter entity
>
> > reference.
>
> suggests to me that you have a syntax error somewhere in your XML (I guess
> one of the .inc files you copied from the templates included with the
> mapquest styles).  I'll attach the copies I use (the paths won't matter
> until you are importing into geoserver anyway.)
>
> While verifying that these work I found that the latest styles from MapQuest
> use some mapnik options that aren't yet handled by mapnik2geotools.  To
> verify that things are working properly (well, as written anyway) I would
> recommend reverting the MapQuest styles to a version from before the last
> revision of mapnik2geotools (which was in February).  You can use git's
> command-line for that:
>
> cd MapQuest-Mapnik-Style && git checkout master@{2011-02-15}
>
> If you are interested in an IDE, the current best IDE for Scala development
> is IntelliJ IDEA -http://jetbrains.com/idea/.
>
> --
> David Winslow
> OpenGeo -http://opengeo.org/
>
>
>
> On Wed, Apr 13, 2011 at 9:15 AM, Beekay <blaithin.kenn...@gmail.com> wrote:
> > Hi David,
>
> > com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseE­xception(Unknown
> > Source)
> >        at
>
> > com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unkn­own
> > Source)
> >        at
>
> > com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknow­n
> > Source)
> >        at
> > com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown
> > Source)
> >        at
>
> > com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanEntityValue(U­nknown
> > Source)
> >        at
>
> > com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanEntityDecl(Un­known
> > Source)
> >        at
> > com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(Unknown
> > Source)
> >        at
>
> > com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDInternalSu­bset(Unknown
> > Source)
> >        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl
> > $DTDDriver.dispatch(Unknown Source)
> >        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl
> > $DTDDriver.next(Unknown Source)
> >        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl
> > $PrologDriver.next(Unknown Source)
> >        at
> > com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
> > Source)
> >        at
>
> > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scan­Document(Unknown
> > > > herehttps://github.com/MapQuest/MapQuest-Mapnik-StyleIhave start to
> > > > get all kinds of issues. I was wondering if you have managed to
> > > > convert these style files to slds, if so can you send me a link to
> > > > them or tell me what I need to do to get the Mapnik2GeoToolsProject to
> > > > convert them to slds.
> > > > Thanks for your time and help
> > > > Blaithín
>
>
>
>  datasource-settings.xml.inc
> < 1KViewDownload
>
>  fontset-settings.xml.inc
> < 1KViewDownload
>
>  settings.xml.inc
> < 1KViewDownload- Hide quoted text -
>
> - Show quoted text -

David Winslow

unread,
Apr 14, 2011, 10:01:57 AM4/14/11
to Beekay, Mapnik to GeoTools Style Conversion
Ok here is a zip file with all SLDs, and a SQL file you can use to transform planet_osm tables created by osm2pgsql to make the tables required.  I am not sure it will be that useful since you have to import so many SLDs to GeoServer by hand, but good luck.  The symbols won't load properly unless you copy the mapquest symbols directory into GeoServer's styles/ directory.

I assumed you had some familiarity with git as it is the source control tool used for this project.  http://git-scm.com/

--
David Winslow
output.zip

JoeG

unread,
Apr 14, 2011, 1:23:33 PM4/14/11
to Mapnik to GeoTools Style Conversion
Hi Dave,

Have you managed to use these generated styles in an OSM deployment?
If so do you have a URL where I can check it out.

//Joe

On Apr 14, 3:01 pm, David Winslow <dwins...@opengeo.org> wrote:
> Ok here is a zip file with all SLDs, and a SQL file you can use to transform
> planet_osm tables created by osm2pgsql to make the tables required.  I am
> not sure it will be that useful since you have to import so many SLDs to
> GeoServer by hand, but good luck.  The symbols won't load properly unless
> you copy the mapquest symbols directory into GeoServer's styles/ directory.
>
> I assumed you had some familiarity with git as it is the source control tool
> used for this project.  http://git-scm.com/
>
> --
> David Winslow
> OpenGeo -http://opengeo.org/
>  output.zip
> 92KViewDownload

David Winslow

unread,
Apr 14, 2011, 3:13:47 PM4/14/11
to JoeG, Mapnik to GeoTools Style Conversion
Well, I have actually done several successful imports at various times - but currently none of them are still running (due to infrastructure considerations at OpenGeo).  Also as currently mentioned earlier in this thread, I haven't been working on the Mapnik conversion recently and the MapQuest style has since adopted some features not understood by my scripts.  That said, OpenGeo is working on a new style based on the MapQuest ones and hopefully this will be available soon.

I will try to find time to produce some screenshots soon; it is unlikely that I'll be able to provide a public demo in the near future.

--
David Winslow

David Winslow

unread,
Apr 18, 2011, 12:14:39 PM4/18/11
to JoeG, Mapnik to GeoTools Style Conversion
Here is a sample import of New York data.  It is somewhat of a work in progress, some fonts and icons are not loading properly (as you can see some of the highway shields are missing, etc.)  


--
David Winslow
Message has been deleted

David Winslow

unread,
Apr 21, 2011, 9:19:53 AM4/21/11
to Blaithin Kennedy, Mapnik to GeoTools Style Conversion
Please keep emails on the public list so Google can find them.

In the mapquest styles, the name of the styles directory can be set in the settings.xml.inc file (which should be produced by copying and editing this template file: https://github.com/MapQuest/MapQuest-Mapnik-Style/blob/master/mapquest_inc/settings.xml.inc.template)

As you can see the default is just "styles" which does not match the actual name of the directory.  Changing this file before generating SLDs, or renaming the styles directory are both good solutions to the problem.

I believe the paths you have listed should work fine.  GeoServer caches icons for styles, so if the icons are still not displaying properly a restart may fix the problem.

--
David Winslow

On Wed, Apr 20, 2011 at 9:35 AM, Blaithin Kennedy <blaithin...@gmail.com> wrote:
Hi David,

I was wondering if you could give me some more help. I moved the
mapquest_symbols folder to geoserver styles folder I wasn't able to
locate any of the symbols needed by the city1.sld file. So I looked a
the sld contents and renamed the folder to symbols as I found the
following line in the sld

               <OnlineResource
xlink:href="symbols/small-city.svg"></OnlineResource>
Is this the right thing to do or am I missing something. My folder
structure is as follows geoserver/data/styles/symbols this contains
all the .svgs in mapquest_symbols.

Thanks for your time and patience
Blaithín

Beekay

unread,
Apr 29, 2011, 10:30:09 AM4/29/11
to Mapnik to GeoTools Style Conversion
Hi David,

When I try to load the Mapquest Mapnik geotiffs into a GeoServer store
I get the following error Could not list layers for this store, an
error occurred retrieving them: Unable to acquire a reader for this
coverage with format: GeoTIFF do you have any idea why this happens or
what I need to do in order to load the geotiffs.

Thanks
Blaithín

On Apr 21, 2:19 pm, David Winslow <dwins...@opengeo.org> wrote:
> Please keep emails on the public list so Google can find them.
>
> In the mapquest styles, the name of the styles directory can be set in the
> settings.xml.inc file (which should be produced by copying and editing this
> template file:https://github.com/MapQuest/MapQuest-Mapnik-Style/blob/master/mapques...
> )
>
> As you can see the default is just "styles" which does not match the actual
> name of the directory.  Changing this file before generating SLDs, or
> renaming the styles directory are both good solutions to the problem.
>
> I believe the paths you have listed should work fine.  GeoServer caches
> icons for styles, so if the icons are still not displaying properly a
> restart may fix the problem.
>
> --
> David Winslow
> OpenGeo -http://opengeo.org/
>
> On Wed, Apr 20, 2011 at 9:35 AM, Blaithin Kennedy <
>
>
>
> blaithin.kenn...@gmail.com> wrote:
> > Hi David,
>
> > I was wondering if you could give me some more help. I moved the
> > mapquest_symbols folder to geoserver styles folder I wasn't able to
> > locate any of the symbols needed by the city1.sld file. So I looked a
> > the sld contents and renamed the folder to symbols as I found the
> > following line in the sld
>
> >                <OnlineResource
> > xlink:href="symbols/small-city.svg"></OnlineResource>
> > Is this the right thing to do or am I missing something. My folder
> > structure is as follows geoserver/data/styles/symbols this contains
> > all the .svgs in mapquest_symbols.
>
> > Thanks for your time and patience
> > Blaithín
>
> > On Thu, Apr 14, 2011 at 3:01 PM, David Winslow <dwins...@opengeo.org>
> > wrote:
> > > Ok here is a zip file with all SLDs, and a SQL file you can use to
> > transform
> > > planet_osm tables created by osm2pgsql to make the tables required.  I am
> > > not sure it will be that useful since you have to import so many SLDs to
> > > GeoServer by hand, but good luck.  The symbols won't load properly unless
> > > you copy the mapquest symbols directory into GeoServer's styles/
> > directory.
> > > I assumed you had some familiarity with git as it is the source control
> > tool
> > > used for this project.  http://git-scm.com/
> > > --
> > > David Winslow
> > > OpenGeo -http://opengeo.org/
>
> > > On Thu, Apr 14, 2011 at 7:01 AM, Beekay <blaithin.kenn...@gmail.com>
> ...
>
> read more »- Hide quoted text -

David Winslow

unread,
Apr 29, 2011, 10:58:28 AM4/29/11
to Beekay, Mapnik to GeoTools Style Conversion
I don't remember having any trouble loading the geotiffs from MapQuest.  The only thing I can think of is that perhaps you've configured geoserver with the wrong path to the geotiff?

--
David Winslow
Reply all
Reply to author
Forward
0 new messages