rinigus / mapnik-styles-sqlite

Mapnik Styles for use with SQLite
Other
7 stars 3 forks source link

import: few countries are missing borders #7

Open rinigus opened 7 years ago

rinigus commented 7 years ago

Countries like Latvia, Guatemala are missing borders on import. This leads to impression of deformed countries, as in https://github.com/rinigus/osmscout-server/issues/166

am2222 commented 6 years ago

I have seen this problem in Iran's too, Is not it because of converting from pbf to sqlite? as you know we have some warnings during this process.

rinigus commented 6 years ago

It is probably related to conversion from PBF to SQLite. I think something is broken in the process, but I will not have any time to look into it in foreseeable future.

am2222 commented 6 years ago

I'll take a loot at that, Also I think there must be some other shapes like "ne_110m_admin_0_boundary_lines_land",builtup_area,ne_10m_populated_places,ne_110m_admin_0_boundary_lines_land,places,processed_p,shoreline_300,world_boundaries_m which I have seen the version of OSM2psql which might cause this problem too, Anyway I am confused about making styles.xml files, Does we can make them automatically based on our data?our you have build them manually?As I just used your preapared mapnik.xml file and just replaced database names.

rinigus commented 6 years ago

style.xml is made using carto tool - manually I was writing carto input files.

am2222 commented 6 years ago

@rinigus It seems the layers which I have said includes some countries borders, I have to edit carto input files to add those shapes. Can you please give me some clues which files should I edit to find out if it is correct or not? thanks

rinigus commented 6 years ago

If its coming from PBF, you would have to look into https://github.com/rinigus/mapnik-styles-sqlite/blob/master/importer/import_pbf.sh and corresponding config file in the same dir. If its separate shapefiles, see configuration.py in the top dir and how the other shapefiles are defined (bottom of that file) and processed in style mml file, such as https://github.com/rinigus/mapnik-styles-sqlite/blob/master/styles/osm-bright/spatialite.mml

rinigus commented 6 years ago

You may find it helpful to read https://github.com/mapbox/osm-bright style documentation and how cartocss works in general. Then it will be easier to work with this style as well

am2222 commented 6 years ago

@rinigus thanks very much for your help, I'll let you know the results. thanks

am2222 commented 6 years ago

well I tried to add those shape files and they are added but does not show borders At all, could it be because of z order?

am2222 commented 6 years ago

well I think this problem could be fixed by adding this lines, (it will add new world boundries shape file)

`
<Style name="world-1">
  <Rule>
   <MaxScaleDenominator>250000000000</MaxScaleDenominator>
    <MinScaleDenominator>6000000</MinScaleDenominator>
    <!-- <PolygonSymbolizer fill="#00f2efe9"> -->
    <!-- </PolygonSymbolizer> -->
    <LineSymbolizer stroke="#b5d0d0" stroke-width="0.5">
    </LineSymbolizer>
  </Rule>
</Style>
<!-- <Style name="world-2">
  <Rule>
   <MaxScaleDenominator>6000000</MaxScaleDenominator>
    <MinScaleDenominator>600000</MinScaleDenominator> 
    <PolygonSymbolizer fill="#00f2efe9">
    </PolygonSymbolizer>
  </Rule>
</Style> -->

<Layer name="world-1" status="on" srs="+proj=merc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs">
<StyleName>world-1</StyleName>
<Datasource>
  <Parameter name="type">shape</Parameter>
  <Parameter name="file">global/world_boundaries_m.shp</Parameter>
</Datasource>
</Layer >`
rinigus commented 6 years ago

I presume that these XML lines will fix the issue, seems logical. But, if you want to use normal style generation flow of this project, you would have to integrate it into CartoCSS way. However, I am not going to merge it unless this extra data file is small. I am using these styles on mobile and have to deliver the data files to the users for storing on devices.

As mentioned earlier, I don't have time to work on it now and will prefer not to alter the style and import scripts at this stage that will be required is new datasource is introduced. Please feel free to fork and develop in your own branch :)

am2222 commented 6 years ago

@rinigus thanks. But the interesting part is that for some countries (based on the first post) the borders have not any problem. Based on my search in current version of osm xml for osm2psql this extra layer does not exist anymore, I have no idea if borders are converted from pbf to sqlite or not, I also have no clue about possible tags for boarders to query database and check it. Anyway thanks for your help, I hope these information heps others. If I could edit them I'll share its link here.

rinigus commented 6 years ago

could use the same approach as for mapbox gl