You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@baremaps.apache.org by "YongGoose (via GitHub)" <gi...@apache.org> on 2025/02/08 07:10:10 UTC

[PR] Display boundaries and borders [incubator-baremaps]

YongGoose opened a new pull request, #948:
URL: https://github.com/apache/incubator-baremaps/pull/948

   fixes #928 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2665880005

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_baremaps&pullRequest=948) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=apache_baremaps&pullRequest=948&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_baremaps&pullRequest=948&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_baremaps&pullRequest=948&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_baremaps&pullRequest=948&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_baremaps&pullRequest=948&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_baremaps&pullRequest=948)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2645352220

   > > I tried to use the `simplify` method of `DouglasPeuckerSimplifier` in the `MultiPolygonDataType` class for simplification, but I couldn’t figure out where the simplification should be applied, so I couldn't implement it.
   > 
   > I think the boundaries should be simplified using materialized views in the sql database with `st_simplifypreservetopology`. For instance, here are the simplifications applied to the natural layer (i.e. polygons).
   > 
   > I think that on the java side, we should probably add logic to build complex geometries corresponding to Boundaries which are not necessarily MultiPolygons. For instance, these geometries may be MultiLineString or GeometryCollection. There is probably some [openstreetmap documentation](https://wiki.openstreetmap.org/wiki/Key:boundary) reading to be made as I'm not sure how communities create boundaries. According to the wiki, all types are involved (nodes, ways corresponding to lines, ways corresponding to polygons, and relations).
   > 
   > ![Screenshot 2025-02-08 at 12 29 55](https://private-user-images.githubusercontent.com/238747/411231611-e11a2797-3f54-4bd0-af66-2f4f6a5b0325.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTgwMTgsIm5iZiI6MTczOTAxNzcxOCwicGF0aCI6Ii8yMzg3NDcvNDExMjMxNjExLWUxMWEyNzk3LTNmNTQtNGJkMC1hZjY2LTJmNGY2YTViMDMyNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOFQxMjI4MzhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wZGEyNThmNGZkNjNjNjJjYjBlYzdkYjg2NDJjMDU3ZDVjNjcxMjUwMjdmMzkwZGE2OTJiZmQwZmQyZWJiNzBkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.hDl1s48PPmHuIrgSHGWtonsJnXqknnP0RT7YCng1YYs)
   > 
   > As the name suggests, the current implementation of the `RelationMultiPolygonBuilder` probably miss the lines which are parts of boundaries, hence the discrepency when looking at the raster map. Maybe, we should introduce a new RelationBoundaryBuilder` that specifically focuses on creating geometries for boundaries and skip the other entities. This would allow to focus solely on this case.
   
   Thank you! 👍🏻
   
   I’ll go ahead and implement it while reading through the document you provided. 
   If I have any questions, I’ll leave a comment on this PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2681131107

   > @YongGoose Sorry, I missed this notification. Do not hesitate to ping me when this happen.
   > 
   > I believe that the openstreetmap relation of the test case 950 is not handled by the default consumer anymore. Maybe we should limit the tests to this consumer for now and ensure that the new one is tested independently.
   > 
   > https://github.com/apache/incubator-baremaps/blob/28e5bb4b9d1693d297dc849074b9126dd392ce4d/baremaps-testing/data/osm-testdata/9/950/data.osm
   
   It’s a common occurrence, so no need to worry!
   I also miss notifications from time to time. 😅
   
   As you mentioned, I’ll add test cases for the newly added consumer.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2665915829

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_baremaps&pullRequest=948) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=apache_baremaps&pullRequest=948&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_baremaps&pullRequest=948&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_baremaps&pullRequest=948&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_baremaps&pullRequest=948&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_baremaps&pullRequest=948&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_baremaps&pullRequest=948)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "bchapuis (via GitHub)" <gi...@apache.org>.
bchapuis commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2665467543

   @YongGoose I think it is a great start. I havn't used the `GeometryCombiner` yet, but according to the javadoc it looks like the right tool. 
   
   From what I understand, the `RelationBoundaryBuilder` consumer handles all relation regardless of their tags. It may be a good idea to add an early return in the accept method for relations that don't have the `boundary` tag. Similarly, it may be a good to add an early return for the relations that have the `boundary` tag in the `RelationMultiPolygonBuilder`. Using this approach, we should then be able to chain the `Consumer`s with the `.andThen` method while ensuring that they don't interfer with each others.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2676252890

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_baremaps&pullRequest=948) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [6 New issues](https://sonarcloud.io/project/issues?id=apache_baremaps&pullRequest=948&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_baremaps&pullRequest=948&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_baremaps&pullRequest=948&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_baremaps&pullRequest=948&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_baremaps&pullRequest=948&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_baremaps&pullRequest=948)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2661372346

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_baremaps&pullRequest=948) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_baremaps&pullRequest=948&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_baremaps&pullRequest=948&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_baremaps&pullRequest=948&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_baremaps&pullRequest=948&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_baremaps&pullRequest=948&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_baremaps&pullRequest=948)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2663296244

   @bchapuis 
   
   First, I decided to implement the Java code first.  https://github.com/apache/incubator-baremaps/pull/948/commits/d17166d12a2867fb778ef841955bddc2fdcdf3dc
   
   As a result, I introduced `RelationBoundaryBuilder`, as you suggested.  
   It processes `nodes`, `ways corresponding to lines`, `ways corresponding to polygons,` and `relations`, following the OpenStreetMap wiki.  
   
   This class is still in its early stages and will likely require many modifications.  
   If my implementation is heading in the wrong direction, I would appreciate any feedback.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "bchapuis (via GitHub)" <gi...@apache.org>.
bchapuis commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2665476010

   Regarding the build, you may want to run `./mvnw spotless:apply` to ensure that the code is well formatted. You may also want to add the Apache License at the begining of the file to ensure that it passes the [apache rat](https://creadur.apache.org/rat/apache-rat-plugin/) check in the CI.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2644556007

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_baremaps&pullRequest=948) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_baremaps&pullRequest=948&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_baremaps&pullRequest=948&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_baremaps&pullRequest=948&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_baremaps&pullRequest=948&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_baremaps&pullRequest=948&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_baremaps&pullRequest=948)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2663286306

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_baremaps&pullRequest=948) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=apache_baremaps&pullRequest=948&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_baremaps&pullRequest=948&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_baremaps&pullRequest=948&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_baremaps&pullRequest=948&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_baremaps&pullRequest=948&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_baremaps&pullRequest=948)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "bchapuis (via GitHub)" <gi...@apache.org>.
bchapuis commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2661620247

   No problem. I hope the following will help clarify the steps. The natural layer is taken as an example. 
   
   **Geometry Validation and Storage:** The current Java code is responsible for processing OpenStreetMap data to create valid polygons geometries for the ways and relations tagged with natural. These geometries are then stored in the PostGIS database without further simplification. This is the java class we discussed.
   
   https://github.com/apache/incubator-baremaps/blob/main/baremaps-openstreetmap/src/main/java/org/apache/baremaps/openstreetmap/function/RelationMultiPolygonBuilder.java
   
   **Simplification in the Database:** Instead of simplifying the geometries in the Java code, this is currently handled within the database. Materialized views are used to store simplified geometries. This allows to perform advanced operations (e.g. filtering, clustering, buffering, etc.) to merge nearby `natural` polygons of the same type (e.g. `forest`, etc.).
   
   https://github.com/apache/incubator-baremaps/blob/28e5bb4b9d1693d297dc849074b9126dd392ce4d/basemap/layers/natural/create.sql#L156
   
   **Vector Tile Querying:** The materialized views containing the simplified geometries are finally queried in the tileset.js file to generate vector tiles. The variable $zoom can be used in queries to select the right table or materialized view (e.g. `osm_natural_z20`).
   
   https://github.com/apache/incubator-baremaps/blob/28e5bb4b9d1693d297dc849074b9126dd392ce4d/basemap/layers/natural/tileset.js#L23
   
   I hope this help. Do not hesitate to ask if you need further details.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2668226814

   > I think it's good idea to open an issue to track this.
   
   I’ve created an issue to track this problem.  
   - https://github.com/apache/incubator-baremaps-site/issues/55
   
   I’m not quite sure how to fix it yet, so it would be great to discuss possible solutions together. 🙂


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2676255029

   > @YongGoose I think it is a great start. I havn't used the `GeometryCombiner` yet, but according to the javadoc it looks like the right tool.
   > 
   > From what I understand, the `RelationBoundaryBuilder` consumer handles all relation regardless of their tags. It may be a good idea to add an early return in the accept method for relations that don't have the `boundary` tag. Similarly, it may be a good to add an early return for the relations that have the `boundary` tag in the `RelationMultiPolygonBuilder`. Using this approach, we should then be able to chain the `Consumer`s with the `.andThen` method while ensuring that they don't interfer with each others.
   
   Thanks for the feedback!
   
   Based on your suggestion, I implemented chaining multiple Consumers using .andThen to ensure they don’t interfere with each other.
   
   Now, the test is failing in `OsmDataTest`, and I'm not sure how to modify the code to fix it yet. I would really appreciate your help.
   ```
   org.opentest4j.AssertionFailedError: 950: Multipolygon with one outer and one inner ring, tags on relation, type boundary.
   Expected:
   POLYGON ((9.01 1.51, 9.01 1.59, 9.09 1.59, 9.09 1.51, 9.01 1.51), (9.03 1.53, 9.03 1.57, 9.07 1.57, 9.07 1.53, 9.03 1.53))
   Actual:
   GEOMETRYCOLLECTION (GEOMETRYCOLLECTION (POLYGON ((9.01 1.51, 9.01 1.59, 9.09 1.59, 9.09 1.51, 9.01 1.51)), LINESTRING (9.03 1.53, 9.03 1.57, 9.07 1.57), LINESTRING (9.07 1.57, 9.07 1.53, 9.03 1.53))) ==> 
   Expected :true
   Actual   :false
   <Click to see difference>
   
   
   	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
   	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
   	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
   	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
   	at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:214)
   	at org.apache.baremaps.openstreetmap.OsmDataTest.runTest(OsmDataTest.java:132)
   	at org.apache.baremaps.openstreetmap.OsmDataTest.lambda$createDynamicTest$1(OsmDataTest.java:72)
   	at java.base/java.util.Optional.ifPresent(Optional.java:178)
   	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
   	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "bchapuis (via GitHub)" <gi...@apache.org>.
bchapuis commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2658472814

   @YongGoose No problem, same situation here, with many deadlines. Looking forward for your contributions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "bchapuis (via GitHub)" <gi...@apache.org>.
bchapuis commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2665976307

   @YongGoose I saw a couple of emails related to the deployment of strict CSP headers on the server of the apache software foundation. I think these new errors maybe related to this. I will try to have a look at it on thursday.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2644565405

   @bchapuis 
   
   It seems that some parts of the lines are not visible, possibly due to incomplete data being saved in the database. 
   Could you please check this?
   
   ![image](https://github.com/user-attachments/assets/4deda12c-e92d-4e3b-b202-91071aafb2f1)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2644556255

   @bchapuis 
   
   
   I tried to use the `simplify` method of `DouglasPeuckerSimplifier` in the `MultiPolygonDataType` class for simplification, but I couldn’t figure out where the simplification should be applied, so I couldn't implement it.
   
   The situations where I think simplification should occur are:
   1. When the zoom level falls below a certain threshold.
   2. When there are multiple islands.
   
   I would appreciate any advice you could offer.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2665890096

   > Regarding the build, you may want to run `./mvnw spotless:apply` to ensure that the code is well formatted. You may also want to add the Apache License at the begining of the file to ensure that it passes the [apache rat](https://creadur.apache.org/rat/apache-rat-plugin/) check in the CI.
   
   Thank you!  
   
   I followed your advice by adding the license and applying `Spotless`, and it worked perfectly. 
   Since I'm more familiar with `Gradle`, I don't use `Maven` often, so I struggled a bit. 
   
   I really appreciate your help! 🙂


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2665966044

   @bchapuis 
   
   Additionally, this is unrelated to the PR, but are you able to see the demo map on the Baremaps site? It doesn’t seem to be displaying properly for me.  
   
   If you're experiencing the same issue, I'll investigate it further tomorrow or the day after and create an issue if necessary.  
   
   I was about to open an issue in the `baremaps-site` repository but thought I should check first, as this might be a problem on my end.
   
   ![image](https://github.com/user-attachments/assets/c6c73814-4ef2-469b-93e1-d2e7f5047e84)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2665931662

   > @YongGoose I think it is a great start. I havn't used the `GeometryCombiner` yet, but according to the javadoc it looks like the right tool.
   > 
   > From what I understand, the `RelationBoundaryBuilder` consumer handles all relation regardless of their tags. It may be a good idea to add an early return in the accept method for relations that don't have the `boundary` tag. Similarly, it may be a good to add an early return for the relations that have the `boundary` tag in the `RelationMultiPolygonBuilder`. Using this approach, we should then be able to chain the `Consumer`s with the `.andThen` method while ensuring that they don't interfer with each others.
   
   Done in https://github.com/apache/incubator-baremaps/pull/948/commits/d128e7b9b12b7697c7d39a746452d385cefbb5ec !


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "bchapuis (via GitHub)" <gi...@apache.org>.
bchapuis commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2665980603

   I think it's good idea to open an issue to track this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "bchapuis (via GitHub)" <gi...@apache.org>.
bchapuis commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2645112759

   > I tried to use the `simplify` method of `DouglasPeuckerSimplifier` in the `MultiPolygonDataType` class for simplification, but I couldn’t figure out where the simplification should be applied, so I couldn't implement it.
   
   I think the boundaries should be simplified using materialized views in the sql database with `st_simplifypreservetopology`. For instance, here are the simplifications applied to the natural layer (i.e. polygons).
   
   I think that on the java side, we should probably add logic to build complex geometries corresponding to Boundaries which are not necessarily MultiPolygons. For instance, these geometries may be MultiLineString or GeometryCollection. There is probably some [openstreetmap documentation](https://wiki.openstreetmap.org/wiki/Key:boundary) reading to be made as I'm not sure how communities create boundaries. According to the wiki, all types are involved (nodes, ways corresponding to lines, ways corresponding to polygons, and relations).
   
   ![Screenshot 2025-02-08 at 12 29 55](https://github.com/user-attachments/assets/e11a2797-3f54-4bd0-af66-2f4f6a5b0325)
   
   As the name suggests, the current implementation of the `RelationMultiPolygonBuilder` probably miss the lines which are parts of boundaries, hence the discrepency when looking at the raster map. Maybe, we should introduce a new RelationBoundaryBuilder` that specifically focuses on creating geometries for boundaries and skip the other entities. This would allow to focus solely on this case.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2661374226

   @bchapuis 
   
   After reading your comment, I tried adding `ST_SimplifyPreserveTopology` to tile.js. https://github.com/apache/incubator-baremaps/pull/948/commits/b0a5e9125557af959ba23d8c3bfff71ad20442c9
   However, I’m wondering if this aligns with your intended approach.
   
   > Maybe, we should introduce a new RelationBoundaryBuilder` that specifically focuses on creating geometries for boundaries and skip the other entities. This would allow to focus solely on this case.
   
   Could you provide a more detailed explanation?
   
   I’ve been spending some personal time studying the documentation for `MapLibre` and `OpenStreetMap`. 
   I also plan to read the paper you’ve written in the future.
   
   Thank you, as always!
   
   PS. I think I'll be able to dedicate more time next week.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2658467195

   @bchapuis 
   
   I’ve been quite busy lately, so this task has been delayed.
   I’ll make sure to complete it by this weekend. 😊


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Display boundaries and borders [incubator-baremaps]

Posted by "bchapuis (via GitHub)" <gi...@apache.org>.
bchapuis commented on PR #948:
URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2680961191

   @YongGoose Sorry, I missed this notification. Do not hesitate to ping me when this happen.
   
   I believe that the openstreetmap relation of the test case 950  is not handled by the default consumer anymore. Maybe we should limit the tests to this consumer for now and ensure that the new one is tested independently.
   
   https://github.com/apache/incubator-baremaps/blob/28e5bb4b9d1693d297dc849074b9126dd392ce4d/baremaps-testing/data/osm-testdata/9/950/data.osm
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org