Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "TRONCON_DE_ROUTE.shp" to the sample project #47

Closed
gioman opened this issue Feb 1, 2024 · 11 comments
Closed

Add "TRONCON_DE_ROUTE.shp" to the sample project #47

gioman opened this issue Feb 1, 2024 · 11 comments

Comments

@gioman
Copy link

gioman commented Feb 1, 2024

While following

https://github.com/3liz/lizmap-pgrouting-module/blob/master/docs/configuration.md

the queries to create the nodes and edges tables are depending on having imported the line vector contained in the mentioned shapefile, but this vector is not found inside

https://demo.lizmap.com/lizmap/index.php/view/media/getMedia?repository=modules&project=pgrouting&path=/media/pgrouting.zip

That zip file contains indeed the SQL with the INSERT statements for the nodes and edges tables, but there aren't the CREATE TABLE ones to create the necessary structure for this tables.

@Gustry
Copy link
Member

Gustry commented Feb 12, 2024

Tables are created by the installation
https://github.com/3liz/lizmap-pgrouting-module/blob/master/pgrouting/install/sql/install.pgsql.sql#L26 L26 and L33

Did you run the installation process completely ?

@gioman
Copy link
Author

gioman commented Feb 12, 2024

@Gustry this

https://github.com/3liz/lizmap-pgrouting-module/blob/master/docs/import/import_french_bdtopo_to_pgrouting.sql

implies this

ogr2ogr -progress --config PG_USE_COPY YES -f PostgreSQL PG:'service=lizmap-pgrouting active_schema=bdtopo' -lco DIM=2 -append -lco GEOMETRY_NAME=geom -lco FID=gid -nln bdtopo.troncon_de_route -t_srs EPSG:2154 -nlt PROMOTE_TO_MULTI "TRONCON_DE_ROUTE.shp"

from

https://github.com/3liz/lizmap-pgrouting-module/blob/master/docs/configuration.md

but "TRONCON_DE_ROUTE.shp" is no part of the repo, nor the Zipped sample project.

@Gustry
Copy link
Member

Gustry commented Feb 12, 2024

TRONCON_DE_ROUTE.shp is an example, from the French GIS data provider. You should adapt this with your own data.
https://docs.3liz.org/lizmap-pgrouting-module/configuration/

You need to populate pgrouting.edges, pgrouting.nodes with your own workflow.

@gioman
Copy link
Author

gioman commented Feb 12, 2024

TRONCON_DE_ROUTE.shp is an example, from the French GIS data provider.

@Gustry yes that is clear, but for testing purposes (to understand how the module works and how the data must be structured) it would be very good to have access to such sample. Is that data not redistributable?

@gioman
Copy link
Author

gioman commented Feb 12, 2024

@Gustry
Copy link
Member

Gustry commented Feb 12, 2024

Indeed, the data is not available because it was project specific (and country specific).

There is the sample demo : https://demo.lizmap.com/lizmap/index.php/view/map?repository=modules&project=pgrouting

The data contains only INSERT, because tables are created by the installation process of the module.

@mdouchin
Copy link
Contributor

@gioman
Copy link
Author

gioman commented Feb 13, 2024

At present, original data can be found here:
https://geoservices.ign.fr/telechargement?bdd%5B0%5D=233&bdd%5B1%5D=233
source :
https://www.data.gouv.fr/fr/datasets/bd-topo-r/

@mdouchin thanks! that helps a lot, also because not everyone has access to such good public data (i.e. here there is no public, good, topologically correct transportation dataset), so having a real example as a starter is very important.

Notes:

  • downloads here

3liz/lizmap-web-client#4030

do not seem to work, files are always served with 0 bytes size.

  • downloads here work

https://geoservices.ign.fr/bdtopo#telechargementshpreg

but the format to be downloaded/used is GPKG not Shapefile, otherwise the SQL script here

https://docs.3liz.org/lizmap-pgrouting-module/configuration/#import-the-road-data-into-pgrouting-graph-nodes-and-edges

won't work because in the SHP version of the data the column names are truncated (and uppercase)

ogr2ogr -progress --config PG_USE_COPY YES -f PostgreSQL PG:'service=lizmap-pgrouting active_schema=bdtopo' -lco DIM=2 -append -lco GEOMETRY_NAME=geom -lco FID=gid -nln bdtopo.troncon_de_route -t_srs EPSG:2154 -nlt PROMOTE_TO_MULTI "TRONCON_DE_ROUTE.shp"

to be more like

ogr2ogr -progress --config PG_USE_COPY YES -f PostgreSQL PG:'service=lizmap-pgrouting active_schema=bdtopo' -lco DIM=2 -append -lco GEOMETRY_NAME=geom -lco FID=gid -nln bdtopo.troncon_de_route -t_srs EPSG:2154 -nlt PROMOTE_TO_MULTI "YOUR_DOWNLOADED_GPKG.gpkg" troncon_de_route

@gioman
Copy link
Author

gioman commented Feb 13, 2024

Indeed, the data is not available because it was project specific (and country specific).

@Gustry understand that, but it is hard to set up a working/testing environment without some sample data, Data that is actually referred in docs without being very clear where to get it.

There is the sample demo : https://demo.lizmap.com/lizmap/index.php/view/map?repository=modules&project=pgrouting

In the "installation" and "configuration" docs pages

https://docs.3liz.org/lizmap-pgrouting-module/installation/

https://docs.3liz.org/lizmap-pgrouting-module/configuration/

I can't see any link to that project. There is a link to a sample project in the sentence "We offer you here a basic project which contains only the layers required and configured for Lizmap." but that returns 404 on 3liz.com but works on github but as stated it is "just" to load/view the already imported data and to be used as template for publishing on LMWC.

This https://demo.lizmap.com/lizmap/index.php/view/media/getMedia?repository=modules&project=pgrouting&path=/media/pgrouting.zip on the other hand is much more useful for a testing setup as it contains the "data.sql" with the inserts (to populate the tables created by installing the module), but there is no mention to this SQL script in docs, just a reference to a sample dataset that is also not linked anywhere. At this point I think you are getting why people gets confused.

Minor detail 1: I also think that "data.sql" should not contain the CREATE SCHEMA pgrouting IF NOT EXISTS; statement, if is assumed that the tables pgrouting.nodes pgrouting.edges are already existing (there are not CREATE TABLE... statements) then the schema "pgrouting" is also already there.

Minor detail 2: It seems your demo here https://demo.lizmap.com/lizmap/index.php/view/map?repository=modules&project=pgrouting is not working, it returns always "No route have been found.".

The data contains only INSERT, because tables are created by the installation process of the module.

See above.

@Gustry
Copy link
Member

Gustry commented Feb 13, 2024

The 404 link was leading to the directory on GitHub https://github.com/3liz/lizmap-pgrouting-module/tree/master/tests/lizmap/instances/pgrouting
With the data in https://github.com/3liz/lizmap-pgrouting-module/tree/master/tests/sql
This was IMHO not easy, I have edited the link to the demo website, in 8f997c9

The ZIP is easier and more info.

Minor detail 1: I also think that "data.sql" should not contain the CREATE SCHEMA pgrouting IF NOT EXISTS;

Fixed 3liz/lizmap-web-client-demo@ce115ea
I hope during the next export of the data that we won't forget, I didn't check the script.

Minor detail 2: It seems your demo here https://demo.lizmap.com/lizmap/index.php/view/map?repository=modules&project=pgrouting is not working, it returns always "No route have been found.".

Thanks for the feedback, it has been fixed !

@gioman
Copy link
Author

gioman commented Feb 13, 2024

Thanks for the replies and patience!

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

No branches or pull requests

3 participants