User:Nickb/Technical

From OpenStreetMap Wiki
Jump to navigation Jump to search

node_tags and other API changes

  • Use the split_node_tags branch of svn
  • Migrate to version 012, creating the new node_tags and old_node_tags tables:
 rake db:migrate VERSION=012 
  • rake db:node_tags - Iterate through the db and insert node.tags into the node_tags and old_node_tags tables
  • rake db:migrate - Migrated up to at least version 13, creating the temp_old_nodes table
  • rake db:node_version - Populates the temp_nodes table adding a version number to the nodes
  • drop nodes
  • rename temp_nodes to nodes
  • Replace the old models with new ones:

Bounding Boxes

BBOX : MinX,MinY,MaxX,MaxY

BBOX : MinLon,MinLat MaxLon,MaxLat


Edinburgh OSGB : 302135, 653628, 339866, 687691

Ediburgh WGS84 : -3.56133713,55.76605875,-2.96771030,56.07822966,

Isle Of Man WGS84 : -5.01270081,54.00926178,-4.1654352,54.4959880

UK WGS84 : -10.700,49.596,2.021,59.344

"Brigton": -0.23347847437187605,50.79231409,-0.007251,50.88499566763454

"London - Beyond M25": -1.0359 51.2282 , 0.4899 51.7626

OGDI Config Notes

http://ogr.maptools.org/drv_ogdi.html

1) ./configure --with-zlib --with-proj

2) Rebuild GDAL with OGDI:

  1. ./configure --with-proj --with-zlib --with-expat

Using OGR2OGR to extract VMAP0

$ ogrinfo gltp:/vrf/home/nick/vmap0/dl/v0sas/vmaplv0/sasaus 'coastl@bnd(*)_line'

This command will dump out the coastl data.

$ ogr2ogr coast_aus.shp gltp:/vrf/home/nick/vmap0/dl/v0sas/vmaplv0/sasaus 'coastl@bnd(*)_line'

To extract to a shape file

APACHE CONFIG NOTES

These configuration settings are found in the "configure" script in the root of the Apache src directory. They are used to set the install directories of the various components of Htttpd. More info here

  • sbindir='${exec_prefix}/sbin'
  • libexecdir='${exec_prefix}/libexec'
  • datadir='${prefix}/share'
  • sysconfdir='${prefix}/etc'
  • sharedstatedir='${prefix}/com'
  • localstatedir='${prefix}/var'
  • libdir='${exec_prefix}/lib'
  • includedir='${prefix}/include'
  • oldincludedir='/usr/include'
  • infodir='${prefix}/info'
  • mandir='${prefix}/man'

And I used:


nick@nick:/usr/src/httpd-2.2.3$ ./configure --prefix=/usr/local/apache --enable-so \ > --enable-cgi \ > --enable-info \ > --enable-headers \ > --enable-rewrite \ > --enable-speling \ > --enable-usertrack \ > --enable-deflate \ > --enable-ssl \ > --enable-mime-magic \ > --enable-module=rewrite \ > --enable-moduel=proxy \


PostGIS

Setting up PostGIS

 # aptitude install postgresql-8.1

Add a postgres user

 # useradd postgres

Change to that user

 # su postgres

Launch postgres

 # /usr/lib/postgresql/8.1/bin/initdb -D /usr/local/pgsql/data/
 or later (if not using system startup scripts)
 # /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data

Lots of messages that end:

 Success. You can now start the database server using:
   /usr/lib/postgresql/8.1/bin/postmaster -D /usr/local/pgsql/data
 or
   /usr/lib/postgresql/8.1/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start

Connect to the server

  1. psql -d <dbname>

It turned out that postgis has to be compiled from source:

make sure postgresql-server-dev is installed

./configure --with-pgsql=/usr/bin/pg_config

You might have to do:

echo /usr/local/lib/ >> /etc/ld.so.conf and than again ldconfig -v,

Importing into PostGIS

Set up the spatial columns

 createlang plpgsql [yourdatabase]
 psql -d [yourdatabase] -f lwpostgis.sql
 psql -U <user> -W [your_db] <  spatial_ref_sys.sql


Import:

 psql -Uusername db_name < oxford.sql

Or:

 ogr2ogr -f PostgreSQL "PG:dbname=pmdev user=nick password=password host=localhost" /home/nick/blah.TAB

To reproject:

 ogr2ogr -f "PostgreSQL" "PG:dbname=pm-dev user=osm password=osm host=localhost" -t_srs "+proj=latlong +ellps=GRS80" \
 -nlt GEOMETRY25D -nln "roadsgb_oct06_wgs84" /home/nick/blah.TAB

Notes on rendering

curl -u nickblack1@gmail.com:<password> http://www.openstreetmap.org/api/0.3/map?bbox=-4.708103580866358,54.0777624687043,-4.28710770049626,54.38235183789009 > iom.osm

Config changes made for pentabarf installation

added:

 local pentabarf     pentabarf                         md5

to pg_hba.conf


Rails Setup

Dependencies:

xml/libxml