gravitystorm / snapshot-server Goto Github PK
View Code? Open in Web Editor NEWServing OSM map requests from an osmosis pgsnapshot schema
Serving OSM map requests from an osmosis pgsnapshot schema
In addition to the fast-as-lightening approach of using osmosis from the command line to load the data, it would be good to have a web interface to add data to projects. Ideally, this would queue uploads and process them asynchronously.
We need better ways to motivate completion of assessment. An overall status (and a list of projects with completion status) is probably the best way to do it.
After running sudo bundle install
then rake db:create
an error is returned:
pnorman@merry:~/osm/snapshot-server/config$ rake db:create
(in /home/pnorman/osm/snapshot-server)
git://github.com/ctran/annotate_models.git (at master) is not checked out. Please run `bundle install`
Project.transfer is pretty much the least efficient way possible to complete the intended task. Before refactoring it though, it would be good to have some tests.
When following the readme and doing osmosis --rx --wp I get the following error
SEVERE: Thread for task 1-read-xml failed
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT version FROM schema_info]; nested exception is org.postgresql.util.PSQLException: ERROR: relation "schema_info" does not exist
Position: 21
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:233)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:406)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:455)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:463)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:471)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:476)
at org.springframework.jdbc.core.JdbcTemplate.queryForInt(JdbcTemplate.java:485)
at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.queryForInt(SimpleJdbcTemplate.java:113)
at org.openstreetmap.osmosis.pgsnapshot.common.SchemaVersionValidator.validateDBVersion(SchemaVersionValidator.java:64)
at org.openstreetmap.osmosis.pgsnapshot.common.SchemaVersionValidator.validateVersion(SchemaVersionValidator.java:47)
at org.openstreetmap.osmosis.pgsnapshot.v0_6.impl.CopyFilesetLoader.run(CopyFilesetLoader.java:78)
at org.openstreetmap.osmosis.pgsnapshot.v0_6.PostgreSqlCopyWriter.complete(PostgreSqlCopyWriter.java:108)
at org.openstreetmap.osmosis.core.progress.v0_6.EntityProgressLogger.complete(EntityProgressLogger.java:61)
at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:110)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.postgresql.util.PSQLException: ERROR: relation "schema_info" does not exist
Position: 21
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:440)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:395)
... 13 more
The current code lack st_ prefixes on some function calls, including
setsrid, in models/project_node.rb
y and x in models/project.rb
and maybe others too?
en.projects.tagged_ways.title - check for nodes and relations too.
There's no tests for osm file uploads.
... rather than just showing a blank table.
At the moment the status is a global configuration, but it's perhaps more appropriate to be able to control this per-project.
It's not a huge priority until someone starts using other values in the status field than those hardcoded into the potlatch2 snapshotserver vector layer.
For sparse datasets, it can be hard (impossible?) to find where the data actually is, and a pain to pan around while mapping. A slippy map on the server with a vector layer (using map calls?) would be useful.
The potlatch 2 vector background layers supports bounds, such as
This avoids querying when the map is panned out of the area. The snippets generated on project#show should calculate appropriate bounds for the project.
Importing a non-trivial OSM file will take some time. As a guide, a 1Mb .osm file takes about 30s on my laptop.
It would be good to return a "processing..." page to the client as soon as the file is received, and process the file in a background task.
Each layer comes with an extent and title, policyfile and url endpoint. There's already automatically generated code for use with potlatch's vectors.xml file.
However, copying and pasting a bunch of XML isn't particularly user friendly, and the problem gets worse if we add more details to the datasets, like a description or a license or whatever.
Tilejson is a nice idea for wrapping up all the details about a tile layer into one document. We should do the same for the vector layers.
This would allow mappers to copy+paste a simple url into their editor, in order to use custom vector background layers. Without this, they need a sysadmin to configure vectors.xml, or else hunt around for a correctly configured instance.
If attempting to do rake db:migrate
on a DB with hstore installed the following error is returned
pnorman@merry:~/osm/snapshot-server$ rake db:migrate
== SetupHstore: migrating ====================================================
-- execute("CREATE EXTENSION hstore")
rake aborted!
An error has occurred, this and all later migrations canceled:
PGError: ERROR: extension "hstore" already exists
: CREATE EXTENSION hstore
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
CREATE EXTENSION IF NOT EXISTS
would fix this. I intend to prepare a patch.
They look like they are supposed to go somewhere else - probably beside the description. At the moment they get their own section and the whitespace looks wrong.
Following the instructions in the readme I ran rake db:migrate
and got an error:
pnorman@merry:~/osm/snapshot-server/config$ rake db:migrate
(in /home/pnorman/osm/snapshot-server)
rake aborted!
PGError: ERROR: relation "geometry_columns" does not exist
LINE 1: SELECT * FROM geometry_columns WHERE f_table_name='schema_mi...
^
: SELECT * FROM geometry_columns WHERE f_table_name='schema_migrations'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
I do not know if this is a code error or a documentation error.
I got spork working for cyclescape - do the same for this project too.
You can get 60k individual node select statements, if large ways extend beyond the bounding box. Needs investigating (with bullet) and optimising.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.