Zverik / Nik4

Mapnik to image export
Do What The F*ck You Want To Public License
123 stars 23 forks source link

Segmentation fault (core dumped) with GeoJSON #11

Closed ustroetz closed 10 years ago

ustroetz commented 10 years ago

I am trying to render a GeoJSON with Nik4. Can you reproduce the following setup?

Command

nik4.py -p 550 -b 11.79656982421875 55.41810255439062 13.4417724609375 56.07356844648383 -z 11 test.xml map.png

Error message

Segmentation fault (core dumped)

GeoJSON test.geojson https://gist.github.com/anonymous/567c1138bb1327662a0b

Stylesheet test.xml

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map[]>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" maximum-extent="-20037508.34,-20037508.34,20037508.34,20037508.34">

<Parameters>
  <Parameter name="bounds">-180,-85.05112877980659,180,85.05112877980659</Parameter>
  <Parameter name="center">0,0,2</Parameter>
  <Parameter name="format">png8</Parameter>
  <Parameter name="minzoom">0</Parameter>
  <Parameter name="maxzoom">22</Parameter>
  <Parameter name="scale">1</Parameter>
  <Parameter name="metatile">2</Parameter>
  <Parameter name="id"><![CDATA[test1]]></Parameter>
  <Parameter name="_updated">1402561991000</Parameter>
  <Parameter name="tilejson"><![CDATA[2.0.0]]></Parameter>
  <Parameter name="scheme"><![CDATA[xyz]]></Parameter>
</Parameters>

<Style name="test" filter-mode="first">
  <Rule>
    <MarkersSymbolizer width="6" fill="#ff4455" stroke="#881133" allow-overlap="true" ignore-placement="true" />
  </Rule>
</Style>
<Layer name="test"
  srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
    <StyleName>test</StyleName>
    <Datasource>
       <Parameter name="file"><![CDATA[/home/uli/Documents/MapBox/project/test1/layers/test.geojson]]></Parameter>
       <Parameter name="layer"><![CDATA[OGRGeoJSON]]></Parameter>
       <Parameter name="type"><![CDATA[ogr]]></Parameter>
    </Datasource>
  </Layer>

</Map>
Zverik commented 10 years ago

It rendered correctly on my machine, but I've noticed you are requesting a very big image: 14529×10284. Maybe you do not have enough memory, or have 32 bit system, or mapnik is old. Try dividing the image into tiles with --tiles 3 (you would need imagemagick installed).

ustroetz commented 10 years ago

Do you have any other ideas on how to get it to work?

Zverik commented 10 years ago

Mapnik 2.2.0 (built from source), 64-bit Ubuntu 14.04: still no error. Does mapnik render other images? Does polytiles.py work, for example? If you run Nik4 with -v option, what is the last line that is printed? layer=test?

ustroetz commented 10 years ago

I tried to run the described process on one of our servers (exact same setup as on my local machine), and it worked fine. Something must be screwed up on my local setup. Thanks for your help! For now I just use shapefiles on my local machine. Everything works fine only the GeoJSON is making problems.