jefffhaynes / LocalMap

1 stars 0 forks source link

What goal do you have? #1

Open charlenni opened 5 years ago

charlenni commented 5 years ago

The title say it. What do you want to make? A rasterizer in C#? Or a rasterizer for a special map library? A vector tile source for a real vector map?

Btw. the first tile looks ok for the first shot. Try to change the rendering process as suggested.

jefffhaynes commented 5 years ago

I need a rasterizer that will work specifically in UWP. At some point I may tackle full vector support but I was planning on starting with tile rastering. I'm certainly open if you have any suggestions.

I have changed the approach to what you suggested. I believe the problem now is that I'm not actually respecting "line-gap-width". I'm currently working on the best approach for doing that in Win2D but I'll commit what I have with your changes.

charlenni commented 5 years ago

Further images are welcome 🙂

jefffhaynes commented 5 years ago

image

As you can see, at certain zoom levels I get what appear to be very thick (in this case, white) lines. I'm currently trying to track down the source of that...

Are you able to get this running on your machine?

charlenni commented 5 years ago

I assume, that the selected style isn‘t very good for this use case. Perhaps try the OSM Liberty style. It has better colors. Than post the result.

No, I didn‘t tried your version. Up to now I only read the code.

jefffhaynes commented 5 years ago

image

charlenni commented 5 years ago

Good, looks better.

I assume, that you have problems with your pen width for outlines (the gray parts around the buildings) and the fill color of your polygons. Check both.

charlenni commented 5 years ago

And there are black lines inside the yellow roads. This aren‘t correct. Perhaps a debug option of your code?

jefffhaynes commented 5 years ago

I agree. That's what I'm looking at now but so far I can't find the issue. It may be my interpolation...

charlenni commented 5 years ago

Perhaps at https://github.com/jefffhaynes/LocalMap/blob/21989cef79f5704978ce29f14891bce177ac32ab/LocalMap/TileRasterer.cs#L217. Is the line size correct?

jefffhaynes commented 5 years ago

image

Oh geez, good catch

charlenni commented 5 years ago

I’m not sure, if you respect the line endings correct. Look in the upper left corner. The yellow road has a small gap at 7 o’clock.

jefffhaynes commented 5 years ago

I'm not sure. I think I'm following style there but I see what you mean. There seems to be an issue with closed polygons and how I'm drawing them though. I don't know if that's related but I'm trying to track it down.

image

jefffhaynes commented 5 years ago

Interestingly, there kind of seems to be an issue with the map here. Here's mine:

image

and here's Maputnik:

image

You can see that Maputnik isn't fully drawing the polygon section below the top

jefffhaynes commented 5 years ago

Fixed the errant line issue...

image

charlenni commented 5 years ago

I assume, that at line https://github.com/jefffhaynes/LocalMap/blob/d8f1dd8d8ddbbaf4b7481d1a4c9f2192b0aa11f5/MapboxStyle/ColorFunctionConverter.cs#L25 the color conversion isn’t correct. The color is given as a hsla() function. Because it isn’t implemented, it returns black/null.

jefffhaynes commented 5 years ago

I'm not sure what you mean. Hsla should be implemented...

https://github.com/jefffhaynes/LocalMap/blob/d8f1dd8d8ddbbaf4b7481d1a4c9f2192b0aa11f5/MapboxStyle/ConverterExtensions.cs#L128

jefffhaynes commented 5 years ago

My problem is that now that I fixed the line issue most roads are missing...

charlenni commented 5 years ago

Could you check, if hsla() returns correct values.

jefffhaynes commented 5 years ago

Yes, it seems to

jefffhaynes commented 5 years ago

I think my check to see if style is valid for a feature is wrong.

Yes, I didn't do what you originally said correctly. Let me fix it...

jefffhaynes commented 5 years ago

Nope, I fixed it but still no roads...ok, taking a break. Thanks for your help

charlenni commented 5 years ago

I assume, that all parts, that use a hsla() color are drawn in black. If I check the map you published with Mapnik, than all this parts have a hsla() or hsl() color.

jefffhaynes commented 5 years ago

Ok maybe you’re right. I’ll check again


From: charlenni notifications@github.com Sent: Sunday, June 9, 2019 4:16 PM To: jefffhaynes/LocalMap Cc: Jeff Haynes; Comment Subject: Re: [jefffhaynes/LocalMap] What goal do you have? (#1)

I assume, that all parts, that use a hsla() color are drawn in black. If I check the map you published with Mapnik, than all this parts have a hsla() or hsl() color.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/jefffhaynes/LocalMap/issues/1?email_source=notifications&email_token=ACKIUR7GKMPL7BTCDVX4QJDPZVQLHA5CNFSM4HWJSEBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXIRKYA#issuecomment-500241760, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACKIUR4WP5RDWKW5WRHTV6TPZVQLHANCNFSM4HWJSEBA.

jefffhaynes commented 5 years ago

Got it! I had a few bugs related to filtering. I'm not sure if there was a bug with hsla processing but I did rewrite it and clean it up. Check it out now...

image

charlenni commented 5 years ago

Looks better, but the outline color of buildings isn’t correct. The code in the style file is

    {
      "id": "building",
      "type": "fill",
      "metadata": {},
      "source": "openmaptiles",
      "source-layer": "building",
      "minzoom": 13,
      "maxzoom": 14,
      "paint": {
        "fill-color": "hsl(35, 8%, 85%)",
        "fill-outline-color": {
          "base": 1,
          "stops": [
            [
              13,
              "hsla(35, 6%, 79%, 0.32)"
            ],
            [
              14,
              "hsl(35, 6%, 79%)"
            ]
          ]
        }
      },
      "layout": {
        "visibility": "visible"
      }
    }

I assume, that you perhaps have a problem with the stops?

jefffhaynes commented 5 years ago

It was another drawing bug

image

jefffhaynes commented 5 years ago

I still have bugs somewhere in my path labeling (that's super tricky) but here it is with some fixes

image

jefffhaynes commented 5 years ago

image

Path labeling!

jefffhaynes commented 5 years ago

Fixed that pattern issue...

image

xivk commented 5 years ago

Kudos on this work, this is difficult and the results look awesome. I did this once in OsmSharp but it never worked as I wanted it to. :+1:

jefffhaynes commented 5 years ago

Thanks! I’m still working on a new layout layer optimized for UWP but I’m actually struggling more with that. I think I’m on approach #11 now...

The tile drawing is still missing symbols and probably a few other things but it’s getting there.


From: Ben Abelshausen notifications@github.com Sent: Wednesday, June 19, 2019 8:06 AM To: jefffhaynes/LocalMap Cc: Jeff Haynes; Comment Subject: Re: [jefffhaynes/LocalMap] What goal do you have? (#1)

Kudos on this work, this is difficult and the results look awesome. I did this once in OsmSharp but it never worked as I wanted it to. 👍

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/jefffhaynes/LocalMap/issues/1?email_source=notifications&email_token=ACKIUR3WFUDQ6JEJTCG6FTDP3IOK7A5CNFSM4HWJSEBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYBUXBQ#issuecomment-503532422, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACKIUR5RZUZ5R56ZYX6UO43P3IOK7ANCNFSM4HWJSEBA.

charlenni commented 5 years ago

You could find a ready approach for a tile server ( that‘s what you make) here. It is a good base too. If you want a tile source for Mapsui, which convert tiles into features, than there is my first try.

All three above lake of a big part of a map: labeling. You have to decide, which labels are draw and which not. There must be an order. Additionally labels, that are on another tile could overlap to this tile. And after all this efforts, you only get a bitmap tile, no vector tile.

I‘m try to overcome the last disadvantage by creating tile as SkPicture, a drawable vector tile, that could be drawn in all zoom levels on a canvas. But I‘m could get a way for the labeling.

jefffhaynes commented 5 years ago

I think the drawing is going ok. I’m sort of working on a replacement for Mapsui for UWP only. I need something with a little more flexibility than what is currently possible with Mapsui.


From: charlenni notifications@github.com Sent: Wednesday, June 19, 2019 1:21 PM To: jefffhaynes/LocalMap Cc: Jeff Haynes; Comment Subject: Re: [jefffhaynes/LocalMap] What goal do you have? (#1)

You could find a ready approach for a tile server ( that‘s what you make) herehttps://github.com/AliFlux/VectorTileRenderer. It is a good base too. If you want a tile source for Mapsui, which convert tiles into features, than there is my first tryhttps://github.com/charlenni/Mapsui.VectorTiles.

All three above lake of a big part of a map: labeling. You have to decide, which labels are draw and which not. There must be an order. Additionally labels, that are on another tile could overlap to this tile. And after all this efforts, you only get a bitmap tile, no vector tile.

I‘m try to overcome the last disadvantage by creating tile as SkPicture, a drawable vector tile, that could be drawn in all zoom levels on a canvas. But I‘m could get a way for the labeling.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/jefffhaynes/LocalMap/issues/1?email_source=notifications&email_token=ACKIUR3YQOSOV4LVTKR5OPLP3JTINA5CNFSM4HWJSEBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYCSCSA#issuecomment-503652680, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACKIUR3NQ5MRGUTDEI6TWQ3P3JTINANCNFSM4HWJSEBA.

charlenni commented 5 years ago

In which way?

jefffhaynes commented 5 years ago

I think Mapsui is obviously very flexible and portable so I don't mean to detract from that. However, there are a few areas I would like to focus on for my project.

But again, please don't take any of this the wrong way. It is clearly an impressive project and there is a good chance I will end up using it when my own efforts fail :)

charlenni commented 5 years ago

No problem. I asked to learn, what could be made better.

The first two points are a problem of flexibility. So I assume, that it is impossible to change something in this part. But the third seems to worth a look. Do you have examples, where Mapsui isn’t correct?