Giter VIP home page Giter VIP logo

docker-openstreetmap-website's Introduction

init database

docker run --rm -e PGHOST=localhost -e PGPASSWORD=xxxxxx -e PGDATABASE=osm soxueren/osm-website:pg

导入数据前需要处理的问题

current_way_nodes 外键导致导入出错问题

-- nearby字段新版缺失问题
-- Add column nearby to the users table
ALTER TABLE public.users
    ADD COLUMN nearby integer DEFAULT 50;
    
-- 解决current_way_nodes表的数据不一致bug    
-- Drop current_way_nodes_node_id_fkey   
ALTER TABLE public.current_way_nodes
 DROP CONSTRAINT current_way_nodes_node_id_fkey

import pbf

# host="localhost:5432"
 osmosis --read-pbf xxx.osm.pbf --used-node --write-apidb host="localhost" database="osm"  user="postgres" password="xxxxxxx" validateSchemaVersion="no"

导入数据后需要处理的问题

osmosis导入数据后出现osmosis账号的user_id=-1的问题

ALTER TABLE public.changesets
    DROP CONSTRAINT changesets_user_id_fkey;
    
-- osmosis导入数据出现user_id=-1的问题

UPDATE changesets set user_id=1 where user_id=-1;
UPDATE users set id=1 where id=-1;

ALTER TABLE public.changesets
    ADD CONSTRAINT changesets_user_id_fkey FOREIGN KEY (user_id)
    REFERENCES public.users (id) MATCH SIMPLE
    ON UPDATE NO ACTION
    ON DELETE NO ACTION;

start osm-web site

docker run -it -d --name osm-web -e PGHOST=localhost -e PGDATABASE=osm -e PGPASSWORD=xxxxxx -p 3000:3000 soxueren/osm-website:srv bundle exec rails server -b 0.0.0.0

get auth key for editor

docker cp settings.local.yml osm-web:/openstreetmap-website/config/settings.local.yml

docker-openstreetmap-website's People

Contributors

soxueren avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

zhaolibingit

docker-openstreetmap-website's Issues

Unable to establish a database connection

Hi,

I built the osm-website:pg image depend on your quickstart.md. I think it's ok (no error)
I ran postgis command before, and then I ran init db command.
But I got:

could not connect to server: Connection refused
	Is the server running on host "localhost" (127.0.0.1) and accepting
	TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
	Is the server running on host "localhost" (::1) and accepting
	TCP/IP connections on port 5432?
Couldn't create 'osm' database. Please check your configuration.
rake aborted!
PG::ConnectionBad: could not connect to server: Connection refused
	Is the server running on host "localhost" (127.0.0.1) and accepting
	TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
	Is the server running on host "localhost" (::1) and accepting
	TCP/IP connections on port 5432?

I tried "telnet localhost 5432", it was connected.
So what I missed? Please help me to run your configuaration

Thanks,

  • init db command: docker run --rm -e PG_HOST=localhost -e POSTGRES_USER=postgres -e PGPASSWORD=123456 -e PGDATABASE=osm osm-website:pg
  • postgis command: docker run --name osm-postgis -it -d -e PG_HOST=localhost -e PGDATABASE=osm -e PGPASSWORD=123456 -p 5432:5432 -v /data/osm-postgis:/var/lib/postgresql/data -d mdillon/postgis:9.5-alpine

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.