Home

Data-Publisher-How-To-Guide-Establish-a-Reference

image

Contents

1. t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_NORTH a_road_polyline shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE STRATEGI_DIR GB_NORTH b_road_polyline shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE STRATEGI_DIR GB_NORTH minor_rd _polyline shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE STRATEGI_DIR GB_NORTH motorway_polyline shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_NORTH primy_rd_polyline shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_SOUTH a_road_polyline shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE STRATEGI_DIR GB_SOUTH b_road_polyline shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE STRATEGI_DIR GB_SOUTH minor_rd _polyline shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE STRATEGI_DI
2. 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH land_use_polyline shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH nat_park_polyline shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH railway_polyline shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt i TRATEGI_DIR GB_SOUTH rivers_polyline shp ogr2ogr append update f ES Shapefile PSG 27700 t_srs OUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUT LE SSTRATEGI_DIR GB_SOUTH txttrans_polyline shp ogr2ogr append update f ES OUTTYPE OUTPUT_DIR OUTFILE ogr2ogr append update f ES OUTTYPE OUTPUT_DIR OUTFILE ogr2ogr appe ES 4 rn We un 3 3 update SOUTTYPE SOUTPUT_DIR SOUT LE ogr2ogr appe ES d 3 Q 2 rn un 3 update SOUTTYPE SOUTPUT_DIR SOUT LE ogr2ogr appe update f ES SOUTTYPE SOUTPUT_DIR SOUT LE ogr2ogr append update f ES SOUTTYPE SOUTPUT_DIR SOUT LE ogr2ogr append update f ES SOUTTYPE SOUTPUT_DIR SOUT LE ogr2ogr append update f ES SOUTTYPE SOUTPUT_DIR SOUT LE ogr2ogr append update f ES SOUTTYPE SOUTPUT_DIR SOUT LE ogr2ogr appen ES a D d m D a Q 2 Ph Pl My Fi h un un un 3 3 3 A rh FL fh un un 3 3 bi 4 rn We 3 el Q update SOUTTYPE SOUTPUT_DIR SOUT LE ogr2ogr appe update f ES SOUTTYPE SOUTPUT_DIR SOUT LE ogr2ogr append update f ES SOUTTYPE SOUTPUT_DIR SOUT LE
3. STRATEGI_DIR Data OrdnanceSurvey StrategiShape data OUTPUT_DIR TestStrategy OUTPUT_SRS EPSG 4258 echo Processing OS OpenData Strategy from STRATEGI_DIR OUTFILE Lines shp OUTNAME Lines OUTTYPE LINESTRING ogr2ogr f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_NORTH admin_polyline shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH coast_polyline shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH ferry_polyline shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH land_use_polyline shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH nat_park_polyline shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH railway_polyline shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH rivers_polyline shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH txttrans_polyline shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH admin_polyline shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH coast_polyline shp Shapefile PSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH ferry_polyline shp Shapefile s_srs EPSG
4. host all all 62 25 96 244 32 md5 sudo vi etc postgresql 8 4 main postgresql conf Replace this line listen_addresses localhost what IP address es to listen on listen_addresses what IP address es to listen on And edit the following lines shared_buffers 128MB 16384 for 8 1 and earlier checkpoint_segments 20 maintenance_work_mem 256MB 256000 for 8 1 and earlier autovacuum off Edit the kernel parameter shmmax to increase maximum size of shared memory sudo sh c echo kernel shmmax 268435456 gt etc sysctl d 60 shmmax conf sudo service procps start Restart PostgreSQL to enable the changes sudo etc init d postgresql 8 4 restart 4 10 Configure Putty Configure Putty for SSH port forwarding Reference Implementation Page 11 of 23 UK Location Programme r b R PUTTY Configuration L 3 gt Category B Terminal Options controlling SSH port forwarding lt Port forwarding Features H Local ports accept connections from other hosts EL Window 7 Remote ports do the same SSH 2 only Appearance Fonwarded ports Remove Behaviour Tan L9999 localhost 5432 Selection d Add new forwarded port Data Source port Proxy Telnet AE Rlogin Local Remote 5 Dynamic SSH Auto IPv4 IPv6 Kex Auth UA X11 Tunnels Bugs X L You can now run PGAdmin and connect via localhost 9999 j New Server Registrat
5. manager ajp localhost 8009 manager Run this to reload the new apache configuration sudo etc init d apache2 reload Uncomment out the lines in Tomcat server xml to enable the AJP connector sudo vi etc tomcat6 server xml Remove the lines lt and gt around the AJP connector definition The usernames passwords and roles can be defined centrally in Tomcat 6 0 by editing the etc tomcat6 tomcat users xml file sudo vi etc tomcat6 tomcat users xml Add this between the tomcat users tags lt role rolename admin gt lt role rolename manager gt lt user username admin password yourpassword roles manager admin gt Restart Tomcat Reference Implementation Page 8 of 23 UK Location Programme sudo etc init d tomcat6 restart You can then login to the Tomcat admin page using a web browser at http yourhostname manager html 4 6 Configure Tomcat To customise Tomcat for running GeoServer in a production environment edit the Java JVM startup parameters here to utilise more memory sudo vi etc default tomcat 6 Find and alter the following lines You may pass JVM startup parameters to Java here If unset the default F Options Djava awt headless tru Xmx128m will be used JAVA_OPTS Djava awt headless tru server Xms48m Xmx512m Edit the java security permissions sudo vi etc tomcat6 policy d 50local policy Add these lines at the bottom grant codebase fil
6. ogr2ogr append update f ES SOUTTYPE SOUTPUT_DIR SOUT LE ogr2ogr append update f ES SOUTTYPE SOUTPUT_DIR SOUT LE SES zi Hy Wei 3 Gs 34 Fh 2 Ry bi Fh Flo We un We Wei 3 3 3 3 Bi H T mn Dm mm mm 0 Im mm mm 0 nm mm E pm mm mp mmm D wn W el S_srs 3 H echo Lines Done OUTFILE Polygons shp OUTNAME Polygons OUTTYPE MULTIPOLYGON ogr2ogr f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_NORTH foreshor_region shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_NORTH lakes_region shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE STRATEGI_DIR GB_NORTH urban_region shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_NORTH woodland_region shp Reference Implementation Page 20 of 23 UK Location Programme ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_SOUTH foreshor_region shp ogr2ogr append update f ESRI S
7. the top with username admin and password geoserver Go to the server status page and you should see d 2 C 465114837 vet fw ketbookmars tat A GeoServer Server Status Summary of server configuration and status SEH al Connections 4 Memory Usage 38 M8 Tona memory JVM Version Sun Merosysters Inc 1 6 0_22 Java HotSpot TM 64 82 Server VM ative JAI true Native JAI ImagelO JAI Maximum Memory 253 MB JAI Memory Usage o ieee memory JAI Memory Threshold 5 0 Number of JAI Tie Threads 7 JAI T e Thread Priority 5 Update Sequence Ei Resource Cache ke Demos Configuration and catalog Reload GeoServer Jul 14 3 07 PM Configuration 20114 3 07 PM xm Mar 14 2 15 PM D I geoserver 20 2 warzip ei e D Sea at canicada E om a vm You can then change the default password for the administrator under the Security Users menu link Also change the contact information under the Contact Information menu link Reference Implementation Page 10 of 23 UK Location Programme 4 9 Configure PostGIS Add a password for the postgres database admin user sudo u postgres i psql U postgres user postgres with password yourpassword q exit To enable remote administration of the PostgreSQL database with PGAdmin edit this file sudo vi etc postgresgql 8 4 main pg_hba conf Comment out the line and add the following line with your machine s IP address local all all ident
8. R GB_SOUTH motorway_polyline shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_SOUTH primy_rd_polyline shp echo Roads Done OUTFILE Text shp OUTNAME Text OUTTYPE POINT ogr2ogr f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE STRATEGI_DIR GB_NORTH txtadmin_text shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE STRATEGI_DIR GB_NORTH txtother_text shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE STRATEGI_DIR GB_NORTH txttrans_text shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE STRATEGI_DIR GB_SOUTH txtadmin_text shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_SOUTH txtother_text shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_SOUTH txttrans_text shp echo Text Done echo Finished Reference Im
9. _srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH settlmnt_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH tourist_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH trans_pt_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH trans_pt_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH txttrans_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH water_ft_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH admin_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH airport_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH land_use_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH nat_park_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH seeds_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH settlmnt_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH settlmnt_point shp Shapefile PSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME
10. a N uk location UK Location Programme Location Information Interoperability Board Data Publisher How To Guide Establish a Reference Implementation for an INSPIRE View Service using a GeoServer UK Location Programme DOCUMENT CONTROL Change Summary Version Date Author Editor Change Summary 1 0 23 Nov 2010 Andrew Radburn Initial Version References Title Version Publication Date Author 1 OS OpenData http www ordnancesurvey co uk oswebsite opendata 2 GeoServer User Guide http docs geoserver org stable en user Reference Implementation Page 2 of 23 UK Location Programme CONTENTS 1 Reference Implementation sssecsscseeesscceresseceeseneneesessenesenscneeseneneesenseneeseseneesenseneseesneesassecesseneneeensenser 4 2 System Requirements iii seccceceedsdesseacezccccesduesscnasveuesscuuerdsessadesancbecodusesserseuesverds 5 2 1 ege EE 5 2 2 e EE 5 3 SKills and AA O EeEee 6 4 STOPS TAO a aa n 7 4 1 InStall SEO cio 270 E ge S EENEG 0 A E e eege led aia H 4 2 install PostgreSQL and PostGIS ion a clica tes n 7 4 3 Install GDAL cio deis 7 4 4 Ei ea teis eave ca goede aaa LAT AA EEE E 7 4 5 Install Apache and Tomcat Servers ooococccccincccnonccononcnoncnonnncnoncnnnn cc non cn nan cn rn nn ran narran rancia 8 4 6 Configure TOMBE AT E 9 4 7 Install Java Advanced Imaging and JAI ImagelO Tools ooooococincccconccioncconancna
11. an look at the shapefiles in a GIS such as ESRI ArcGIS or an open source GIS such as Quantum GIS QGIS When the data has been loaded into the database you can check the PostGIS tables have loaded correctly with a tool such as PgAdmin You can also view the PostGIS tables directly in QGIS to see if they are OK The field names referred to in a SLD are case sensitive so make sure they match with the columns named in your PostGIS database Some people prefer to work with a command interface and some with a GUI All the tasks done via PgAdmin can also be done on the command line using the psql command When creating a database from the PostGIS template with a different user as owner make sure you change the ownership of the geometry_columns table and spatial_ref_sys table to the same user Reference Implementation Page 18 of 23 UK Location Programme 7 LESSONS LEARNT lt may take longer than planned to write a script to gather re project and load the data into PostGIS tables Although this process may only be needed once some data sets require a regular update cycle and so the process should be as automated as possible Make sure documentation and articles read from the Web apply to the versions of software you are currently using Reference Implementation Page 19 of 23 UK Location Programme APPENDIX A bin bash Script to collate OS OpenData Strategi shapefiles Andy Radburn 17th Nov 2010
12. base geometry_columns and spatial_ref_sys to the user created above E Table geometry_columns a Properties Inherits Columns Constraints Auto vacuum Privileges SQL Name geometry_columns DI 16762 Owner vector Tablespace lpg_default e Of type Fill Factor Has OIDs Y Comment Use replication Help OR Cancel 4 11 Configure Data Upload the datasets to the server using PSFTP part of Putty software Create and run a script to pre process the data and re project it into ETRS89 See Appendix A for an example script used to collate and re project the Strategi OS OpenData Possibly due to some incompatible versions of some packages we found we had to link to the correct Proj4 library to be able to re project the data sudo ln s usr lib libproj so 0 usr lib libproj so Reference Implementation Page 13 of 23 UK Location Programme 4 12 Load Data Crate and run a load script to load the data into the PostGIS database The ogr2ogr program automatically creates any database tables and updates the geometry_columns table with the required details Sometimes the PGCLIENTENCODING environment variable has to be set to enable accented characters to be handled correctly See Appendix B for an example of how to load pre processed Strategi shapefile data into a PostGIS database 4 13 Configure Workspace Add a new
13. e catalina base webapps geoserver WEB INF classes permission java security AllPermission D grant codebase file catalina base webapps geoserver WEB INF lib permission java security AllPermission y 4 7 Install Java Advanced Imaging and JAl ImagelO Tools Install the native Java Advanced Imaging JAl as defined in the GeoServer User Guide 2 wget http download java net media jai builds release 1_1_3 jai 1_1_3 lib linux amd64 jre bin sudo cp jai 1_1_3 lib linux amd64 jre bin usr lib jvm java 6 sun jre cd usr lib jvm java 6 sun jre sudo sh jai 1_1_3 lib linux amd64 jre bin Accept license agreement sudo rm jai 1_1_3 lib linux amd64 jre bin Install JAI ImagelO tools wget http download java net media jai imageio builds release 1 1 jai_imageio 1_1 lib linux amd64 jre bin Reference Implementation Page 9 of 23 UK Location Programme sudo cp jai_imageio 1_1 lib linux amd64 3jre bin usr lib jvm java 6 sun jre cd usr lib jvm java 6 sun jre sudo su export _POSIX2_VERSION 199209 sh jai_imageio 1_1 1ib linux amd64 3re bin Accept license agreement rm jai_imageio 1_1 lib linux amd64 jre bin exit 4 8 Install GeoServer Download the latest stable GeoServer WAR file from http geoserver org display GEOS Stable Install this WAR file via the Tomcat manager page Go to the GeoServer main page http yourserver geoserver and log in at
14. hapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_SOUTH lakes_region shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE STRATEGI_DIR GB_SOUTH urban_region shp ogr2ogr append update f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_SOUTH woodland_region shp echo Polygons Done OUTFILE Points shp OUTNAME Points OUTTYPE MULTIPOINT ogr2ogr f ESRI Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE SSTRATEGI_DIR GB_NORTH admin_font_point shp ogr2ogr append update f ES Shapefile s_srs EPSG 27700 t_srs OUTPUT_SRS nln OUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE TRATEGI_DIR GB_NORTH airport_font_point shp ogr2ogr append update f ES Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln OUTNAME nlt SOUTTYPE OUTPUT_DIR OUT LE TRATEGI_DIR GB_NORTH land_use_font_point shp ogr2ogr append update f ES Shapefile s_srs EPSG 27700 t_srs OUTPUT_SRS nln OUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUTFILE TRATEGI_DIR GB_NORTH nat_park_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH seeds_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_NORTH settlmnt_font_point shp Shapefile s
15. ion Properties Name InspireWMS Host localhost Port 9999 E Maintenance DB postgres Username postgres Password Store password Y Restore en Y DB restriction Service Connect now bi Colour Group Servers tee Las lee J Create a POSTGIS template database sudo u postgres i createdb postgistemplate createlang plpgsql postgistemplate psql d postgistemplate f usr share postgresql 8 4 contrib postgis sql psql d postgistemplate f usr share postgresql 8 4 contrib spatial_ref_sys sql psql d postgistemplate f usr share postgresql 8 4 contrib postgis_comments sql exit Using PGAdmin it is now possible to login and create a user via New Login Role Use vector as the username and tick the Can create database objects box Create database using the postgistemplate as a template database and the owner set to the user created above Reference Implementation Page 12 of 23 UK Location Programme H F New Database ua Properties taras press 5 Name vector OID Owner vector X Encoding ures y Template postgistemplate y Tablespace lt defauit tablespace gt y Schema restriction Collation X Character type X Connection Limit 1 Comment Hp L oe J eo pl j L Alter the owner of the two tables created in the new data
16. nccnnrnanancnnnnnn nac cnarcannncnnnns 9 4 8 Install GeoServer EE 10 4 9 Configure PostGIS EEN 11 4 10 Configure PUY EE 11 4 11 Configure Dala EE 13 4 12 Load H DI CT 14 4 13 Configure ee EE 14 4 14 Configure Ee 14 4 15 Styling Au ET EE 15 4 16 Configure the layers E 16 4 17 Configure the layer oroup ona non nnnnnn sdei Cata nnnnnnnnnenanncninns 16 5 Time Tak E 17 6 Handy ll 18 7 LESSONS LOAM A SA ATARAASA NAANA NSONARRASAANAdAAA RABAS MANRO ESnAsR ESAS nASRSRARANESA ATESA 19 Reference Implementation Page 3 of 23 UK Location Programme 1 REFERENCE IMPLEMENTATION This document describes the building of a Reference Implementation of an INSPIRE View Service using the Open Source software GeoServer and PostGIS The Reference Implementation holds the OS OpenData vector datasets Strategi and Vector Map District 1 Reference Implementation Page 4 of 23 UK Location Programme 2 SYSTEM REQUIREMENTS These are the hardware and software specifications used to build the Reference Implementation 2 1 Hardware e An Amazon EC2 Machine Image running Ubuntu 10 04 LTS Server Large Instance 7 5 GB memory 4 EC2 Compute Units 2 virtual cores with 2 EC2 Compute Units each 850 GB instance storage 64 bit platform UO Performance High AMI name mi large e Laptop desktop computer e Internet connection between the two 2 2 Software e Ubuntu 10 04 LTS e Sun Java Runtime Environment 64 bit server VM 1 6 0_22 e Java Ad
17. nlt TRATEGI_DIR GB_SOUTH tourist_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH trans_pt_font_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt TRATEGI_DIR GB_SOUTH trans_pt_point shp Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt STRATEGI_DIR GB_SOUTH txttrans_font_point shp ogr2ogr append update Shapefile s_srs EPSG 27700 t_srs SOUTPUT_SRS nln SOUTNAME nlt SOUTTYPE SOUTPUT_DIR SOUT LE SSTRATEGI_DIR GB_SOUTH water_ft_font_point shp un 3 3 H We 3 E z Fh J un 3 el ogr2ogr append update SOUTTYPE OUTPUT_DIR OUTFILE ogr2ogr appe update E SOUTTYPE SOUTPUT_DIR SOUTFILE E 3 34 H bi Nn We 3 5 Q 34 rn bi 3 J 1 3 ogr2ogr appe update SOUTTYPE SOUTPUT_DIR SOUTFILE ogr2ogr appe update E SOUTTYPE SOUTPUT_DIR SOUTFILE E 3 v5 US Q Q z Fh RL rn We 3 3 n 3 ogr2ogr appe update SOUTTYPE SOUTPUT_DIR SOUTFILE d y a Kei 3 1 3 ogr2ogr append update SOUTTYPE SOUTPUT_DIR SOUTFILE J H Di Nn 3 J 1 3 ogr2ogr append update SOUTTYPE SOUTPUT_DIR SOUT L A Fh El We 3 J 3 1 3 EJ ogr20ogr append update SOUTTYPE SOUTPUT_DIR SOUTFILE ogr2ogr append update E SOUTTYPE SOUTPUT_DIR SOUTFILE E 4 Hi 3 J 34 Hy 3 J 3 T n 3 ogr2ogr appe update SOUTTYPE SOUTPUT_DIR SOUTFILE ogr2
18. nstall Java Install the Sun Java6 Java Runtime Environment sudo add apt repository deb http archive canonical com lucid partner sudo apt get update sudo apt get install sun java6 Jre sun jJava6 fonts sudo update java alternatives s jJava 6 sun To check the version of Java installed use java version This should report back with java version 1 6 0_22 Java TM SE Runtime Environment build 1 6 0_22 b04 Java HotSpot TM 64 Bit Server VM build 17 1 b03 mixed mode Reference Implementation Page 7 of 23 UK Location Programme 4 5 Install Apache and Tomcat Servers Although strictly only a servlet container is needed to run GeoServer installing both Apache and Tomcat servers on the same machine enables it to be more flexible in serving other data from Apache This will enable the machine to act as a full web portal as well as a data server using such packages as Drupal CMS or even a Wordpress Blog Install the server packages sudo apt get install apache2 sudo apt get install tomcat6 tomcat6 admin Enable the communication between Apache2 and Tomcat sudo a2enmod proxy_ajp sudo vi etc apache2 conf d proxy_ajp conf Add the following lines lt Proxy gt Order deny allow Allow from all lt Proxy gt ProxyPass geoserver ajp localhost 8009 geoserver ProxyPassReverse geoserver ajp localhost 8009 geoserver ProxyPass manager ajp localhost 8009 manager ProxyPassReverse
19. od 755 symbols The SLDs use a non default font for the text rendering so we have to install some extra fonts Enable multiverse in etc apt sources list sudo vi etc apt sources list Add the following line deb http eu west 1 ec2 archive ubuntu com ubuntu lucid main multiverse Then install the fonts Reference Implementation Page 15 of 23 UK Location Programme sudo apt get update sudo apt get install msttcorefonts 4 16 Configure the layers Add the layers from the PostGIS data store as shown in the GeoServer User Guide To each layer add the appropriate style as defined in the section above 4 17 Configure the layer group A layer group can now be created with the layers defined in the following order Polygons Lines Roads Points Text This will draw the combined layer in the correct order with polygon areas on the bottom overlaid with lines roads then points and finally text on the top Reference Implementation Page 16 of 23 UK Location Programme 5 TIME TAKEN The Reference Implementation took two people about five days to build the system install the software load the data configure the system and test the results The bulk of the time was taken writing scripts to load and re project the data Reference Implementation Page 17 of 23 UK Location Programme 6 HANDY HINTS At each stage check the data to see that the processes are working So for the conversion process you c
20. ogr appe update SOUTTYPE SOUTPUT_DIR SOUTFIL ogr2ogr appe update lt SOUTTYPE SOUTPUT_DIR SOUTFILE U B Q q H el 3 1 3 U B Q z Hy el 3 uU 3 d y Q 3 h el Wei 20 D 1 D Ap mm D mm 0 mm nm om mp Dm mm D mm pm mm mm 0 mm mm mm mp Dm mm mm mp Dm 1 D RW el 3 un 3 E ogr2ogr append update SOUTTYPE OUTPUT_DIR OUTFILE J H Di un 3 J 3 T n 3 el ogr2ogr append update SOUTTYPE SOUTPUT_DIR SOUT L 3 z Fh bi Wei un 3 el ogr20ogr append update SOUTTYPE OUTPUT_DIR OUTFILE ogr2ogr appe update E SOUTTYPE SOUTPUT_DIR SOUTFILE E 4 H 3 J 3 T un 3 el 5 a 8_5YS 3 jJ H Wei 3 ogr2ogr appe update SOUTTYPE SOUTPUT_DIR SOUTFILE ogr2ogr appe update SOUTTYPE SOUTPUT_DIR SOUTFILE 3 d D Q q H un 3 el 3 Gs Q 3 Fh E Wei un 3 ogr2ogr append update SOUTTYPE SOUTPUT_DIR SOUT LE A rh 1 P Wei 3 J J H Di un D echo Points Done Reference Implementation Page 21 of 23 UK Location Programme OUTFILE Roads shp OUTNAME Roads OUTTYPE LINESTRING ogr2ogr f ESRI Shapefile s_srs EPSG 27700
21. plementation Page 22 of 23 UK Location Programme APPENDIX B export PGCLIENTENCODING WIN INPUT_DIR TestStrategy ogr2ogr a_srs 1252 dbname vector password yourpassword ogr2ogr a_srs EPSG 4258 n ogr2ogr a_srs EPSG 4258 f dbnam ogr2ogr a_ dbnam ogr2ogr a_ dbnam e vec e vec e vec tor password you srs EPSG 4258 f tor password you srs EPSG 4258 f tor password you EPSG 4258 f PostgreSQL PG host localhost user vector SINPUT_DIR Lines shp lt GEOMETRY f PostgreSQL PG host localhost user vector dbname vector password yourpassword SINPUT_DIR Polygons shp rpassword rpassword rpassword PostgreSQL PG host localhost user vector SINPUT_DIR Points shp PostgreSQL PG host localhost user vector H SINPUT_DIR Roads shp PostgreSQL PG host localhost user vector SINPUT_DIR Text shp Reference Implementation Page 23 of 23
22. vanced Imaging 1 1 3 e JAI ImagelO Tools 1 1 e Tomcat Serviet Container 6 0 24 e Apache Web Server 2 2 14 e GeoServer 2 0 2 e PostgreSQL 8 4 5 e PostGIS 1 4 0 2 e PgAdmin 1 12 1 e GDAL 1 6 3 e Putty 0 60 e Web browser Chrome 7 and Firefox 3 6 10 Reference Implementation Page 5 of 23 UK Location Programme 3 SKILLS AND RESOURCES The skills and knowledge required were Ubuntu Linux administration Using a command line via SSH Shell scripts Running GDAL and OGR2OGR programs Database skills Using PGAdmin Coordinate Reference Systems Knowledge of the datasets to be published Two IT resources were used with the above skills Reference Implementation Page 6 of 23 UK Location Programme 4 STEPS TAKEN 4 1 Install Server An Amazon AMI installation of Ubuntu 10 04 Lucid Lynx LTS Server was used as the basis of the Reference Implementation This AMI has a 64 bit hardware architecture and so 64 bit versions of programs have to be used where appropriate When the server has been installed it first needs to be updated with any security and patch upgrades So login as the administrator and from the terminal command line enter the commande sudo apt get update sudo apt get upgrade 4 2 Install PostgreSQL and PostGIS Installing PostGIS will also install PostgreSQL first as a dependency sudo apt get install postgresql 8 4 postgis 4 3 Install GDAL sudo apt get install gdal bin 4 4 I
23. workspace which will group your layers together logically 3 El C 0465114837 k ven k Nork yA Ze GeoServer 4 14 Configure Data Store Add the PostGIS data store to GeoServer Step by step instructions can be found in the GeoServer User Manual under the Getting Started Adding a PostGIS table section Reference Implementation Page 14 of 23 UK Location Programme gs About Geoserver Basic Store Info Workspace 2 osgb si d owe es Data Source Name WFS vector Descript 35 OpenDala Vector dataset Y Endiod Connection Parameters dbtype Layer Preview eww ordnancesurvey co uk Expose primary bey man connections iran Connections fetch uze Connection timeout 4 15 Styling with SLDs In GeoServer styling is accomplished using a markup language called Styled Layer Descriptor or SLD for short See the GeoServer User manual for detailed instructions on how to write and load a SLD into GeoServer Add the styles for each layer type using the admin panel of GeoServer The SLDs use external graphics for some of the map symbols such as road name shields In this case these symbols are referenced relative to the SLD so copy over the directory of symbols cd var lib tomcat 6 webapps geoserver data styles sudo mkdir symbols sudo chown tomcat6 symbols sudo chgrp tomcat6 symbols sudo chmod 777 symbols Use SFTP to copy over symbols directory sudo chm

Download Pdf Manuals

image

Related Search

Data Publisher How To Guide Establish a Reference

Related Contents

User Manual Commander T Series  Décembre 2014 – Version n°1 - Les services de l`État dans l`Aisne  ENUK8T890 AM2  develop PDF - Read the Docs  無印良品 オーブントースター・縦型(KOS  

Copyright © All rights reserved.
Failed to retrieve file