GithubHelp home page GithubHelp logo

flohoff / plbuildingsnrw Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 16 KB

New server component for the josm plbuildings plugin to use with different datasets.

Perl 100.00%
josm openstreetmap plbuildings

plbuildingsnrw's Introduction

Purpose

Josm currently lacks an easy way to import features from an Standard WFS based service. So importing/updating for example buildings which are available in a lot of regions in the world is basically impossible on a large scale.

For Northrhine-Westfalia there was a solution with the "importer2" plugin and a C# based companion tool which downloads WMS image tiles, converts them back to vectors with the help of OpenVision and then passes it to josm. This solution seems to be basically unmaintained and does not work very well.

So the idea is to use a different plugin which is capable of importing vectors by point and click and simply rewrite the server component.

The plugin which works is plbuildings used for Building Import in Poland. By simply changing the URL one can use it for other regions, as long as the server returns expected output.

Installation

Webserver installation:

cd /var/www/
git clone https://github.com/flohoff/plbuildingsnrw/
cd plbuildingsnrw

Create config containing the database informations:

cp dot-config.plbuildingsnrw.json .config.plbuildingsnrw.json
vi .config.plbuildingsnrw.json

Configure apache2:

ScriptAlias /plbuildingsnrw /var/www/plbuildingsnrw/plbuildingsapi
<Location /plbuildingsnrw/>
	Options ExecCGI
	SetHandler fcgid-script
</Location>

Install postgres and create database:

su - postgres -c "createuser dbuser"
su - postgres -c "createdb hu_nrw -O dbuser"
su - postgres -c "psql hu_nrw -c 'create extension postgis'

Then download the Hausumringe NRW Shape:

https://www.opengeodata.nrw.de/produkte/geobasis/lk/akt/hu_shp/

Unzip it and load it into your new database with ogr2ogr

ogr2ogr -f "PostgreSQL" \
	-nlt MULTIPOLYGON \
	-a_srs "EPSG:5652" \
	-nln "hu_nrw" \
	PG:"dbname=hu_nrw" \
	hu_shp.shp

Now you should be ready and this command should return an osmxml file:

curl "https://localhost/plbuildingsnrw/v1?lat=51.904858&lon=8.3486155&daDta_source=bdot&search_distance=3.0"

plbuildingsnrw's People

Contributors

flohoff avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.