Is it possible to serve files in SRS 4326? I am following the directions for deploying my own server, and in the section for OSM Bright I see a snippet regarding WGS84 (what I think is 4326), but that's all I see.

I am able to get my tiles to display, but there's ZERO style overlayed on them. All I see is the planet without any cities, roads, etc.

Am I on the wrong track?

asked 28 Oct '16, 14:27

ismail44's gravatar image

ismail44
11112
accept rate: 0%

I don't think so, but it depends what track you're following. Can you tell us what you have done so far? Lot of guidance you'll find is dedicated to give you a map in Mercator, so it can be a good idea to have a small extract of OSM rendered in this projection then adapt the database and style for 4326.

(29 Oct '16, 08:06) yvecai

I have followed the instructions for installing openstreet on ubuntu 14.04 from scratch to the letter. The only difference is that I am importing the planet with the "-l" switch in the osm2pgsql command.

(29 Oct '16, 14:25) ismail44

Are you sure your style file works in 4326?

(29 Oct '16, 21:11) yvecai

That's what I think is wrong... my styles aren't showing up?

(30 Oct '16, 01:36) ismail44

Before correcting your style, maybe try to render a map in Mercator if not already done.

(30 Oct '16, 06:26) yvecai

So... serving the tiles in spherical mercator worked just fine... I guess the trick now is going to be to find out how to serve them in lat/lon mercator... which, I would expect that I just need to find the correct .shp files for OSMBright in the correct mercator???

(31 Oct '16, 14:35) ismail44
showing 5 of 6 show 1 more comments

The style has a list of layers - usually in an .mml or .yml file - and each layer has projection information to go with it. Since OSMBright is made for a database imported in Mercator units, and yours is in latitude and longitude, nothing will work - in effect, your data for the whole world will crouch somewhere near "null island" in the sea off Africa.

But all is not lost, you just need to inform your style that the data source is in EPSG:4326 instead of Mercator, then things will work again as expected. Look for layers configured to access the database with something like

"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"

and change that to

"srs" : "+init=epsg:4326"

BUT:

This whole exercise is only half of what you want. It is good that the style now knows your data source is in EPSG:4326 but you will also want to request tiles in that projection. It is no problem to use a command line tool like nik2img.py to create images in EPSG:4326 but all the standard tile generating programs like renderd etc. are geared towards the EPSG:3857 tiling scheme (where the world is quadratic). You'll have a hard time setting these standard utilities up to support non-mercator tiles because the assumption that standard mercator tiles are used is hardcoded in many places.

permanent link

answered 31 Oct '16, 22:47

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
70.9k826431106
accept rate: 24%

@frederik, thanks for a very insightful comment. I am getting my tiles from osm in .pbf format and using osm2pgsql to import them. If I pass in the "-l" option, would that take care of my tile generation problem (Assuming, of course, that I fix the style's mercation)?

(31 Oct '16, 23:41) ismail44

The maps that you can produce are (unless we're talking north and south of 85°) the same, wether you import without -l and use the unmodified style, or import with -l and correct for that in the style. The thing you want to do differently is the actual production of the tiles. The problem with that is that the "Google Mercator" tiling scheme is standardised and well documented - if you give me the coordinates of a tile I can tell you exactly what's going to be on that tile. But to my knowledge an EPSG:4326 tile scheme is not standardised. It begins with the world tile at zoom 0 - in Google Mercator this is obvious, it's one single quadratic tile. But in EPSG:4326 the world is a rectangle twice as wide as it is high. Does that mean we have two tiles on z0? Or one tile where the bottom half is empty? Or the top half? Or 64 pixels unused above the world image and 64 pixels below? When a certain tile is requested, the rendering engine needs to know which bounding box to render the tile for, and this will be hard-wired to EPSG:3857 in most setups.

(02 Nov '16, 23:37) Frederik Ramm ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×8

question asked: 28 Oct '16, 14:27

question was seen: 1,456 times

last updated: 02 Nov '16, 23:37

powered by OSQA