<div dir="ltr">I am completely new to both OSM data and PostGIS, and I have a few questions, which I thought would be best asked in this mailing list. If you can think of another mailing list where these questions would be more appropriate, please let me know.<br>
<br>I am currently using osm2pgsql to import the planet osm data. This is taking a while, expectedly, and I'm using --flat-nodes in order to save space, as well as -k, which according to -h is for the hstore.<br>For reference, this is the full command I am running:<br>
osm2pgsql -c -d mapdatabase -U myuser -W --slim -C 18000 -k --flat-nodes=/var/planet/planet_nodes.cache --number-processes 4 -v<br><br>I would like to use my server later on for tile-serving purposes (using Mapnik and mod-tile, and/or TileStache), but I would also like to be able to run queries that give me interesting data for an Android app I will build.<br>
Because I am using flat-nodes, will I still be able to make queries to calculate distances, find points of interest (such as detecting hills around a point, ...)<br><br>The PostGIS in Action book has an interesting example of query:<br>
"Suppose the task at hand is to find the total length of all interstate highways in the state of Utah. We search for two tables: one with the polygons for all the states and one with all interstate highways in the United States, represented as linestrings. Next we extract the polygon that represents Utah from the states table and perform an SQL join with the highways table using<br>
the geometric intersects function as the join operator and geometric intersection as<br>our output function. The output of that query would be those portions of all highways<br>within the state of Utah."<br><br>Is such a query doable with the postgis database generated by osm2pgsql? I understand osm2pgsql is focused on tile rendering, but I'm curious to see how much can be done in terms of analysis with it, not just for roads but for looking for distinct features in the environment (forest, parks, hills, ...) within a given range. Does using flat-nodes for the import limit the capability to do spatial queries in any way?<br>
<br>Finally, I would also like to create a custom design for rendering tiles. I have taken a look at osm.xml located in my local directory, and it looks like this is the right file to override to design tiles a little differently in terms of look and feel. However, I've also tried using TileMill, and was wondering if this is something that can be used with Mapnik as well.<br>
<br>Thank you for your interest and for your guidance.<br><br>Loic Duros<br></div>