Skip to content

Conversation

@etienneJr
Copy link
Contributor

Context

Following #740 we use Attribute("obj_type","way") in process.lua way_function to include this information in cartes.app tiles. But it is not working well for ways that come from a relation, we have to check the tags, it is not a direct information.

Solution

I wrote this PR to create a function OsmType() which returns the true OSM type of the object, on the same model than the existing Id() function.

Example

Using this in process.lua:

Attribute("OsmId", Id())
Attribute("OsmType", OsmType())

I can directly get tiles with the correct type information
image

@systemed
Copy link
Owner

Thanks - this looks good! Sorry for the delay in looking at it. In:

return (isRelation ? "relation " : isWay ? "way " : "node ");

could you remove the trailing spaces?

@etienneJr
Copy link
Contributor Author

Well, I really don't know why I put those spaces there, but anyway, I've corrected them. Thanks for the review.

I also checked that I could add type in the tiles by using this new OsmType() function (using this lua script), and it worked as expected

image

Why did the cheks failed ? Do I have to correct something else ?

Thanks !

@systemed systemed merged commit 80f53f3 into systemed:master Sep 29, 2025
1 of 7 checks passed
@systemed
Copy link
Owner

That's great - thank you!

Don't worry about the tests for now - they're broken and need some attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants