PostGIS and GeoMOOSE - PowerPoint PPT Presentation

1 / 44
About This Presentation
Title:

PostGIS and GeoMOOSE

Description:

Select English for the language (or other language if you want) ... Add the GiST index option (These are the spatial indexes). Click next. Install PostgreSQL ... – PowerPoint PPT presentation

Number of Views:644
Avg rating:1.0/5.0
Slides: 45
Provided by: jimkl9
Category:
Tags: geomoose | postgis | gist

less

Transcript and Presenter's Notes

Title: PostGIS and GeoMOOSE


1
PostGIS and GeoMOOSE
2
Install PostGIS Spatial Database
  • Install PostgreSQL
  • Install PostGIS Add-on
  • Load Data into the PostGIS database
  • Use PgAdmin to view data
  • Configure Mapserver to use PostGIS

3
Install PostgreSQL
  • Extract the postgreSQL installer to a temporary
    location.

4
Install PostgreSQL
  • Run the PostgreSQL installer by running SETUP.BAT
    in the temporary directory.

5
Install PostgreSQL
  • Run the installer. Select English for the
    language (or other language if you want).
  • Click next until you get to the install options
    screen. On this screen select the defaults and
    click next.

6
Install PostgreSQL
  • Select a password you will remember and click
    next.
  • Let it create the account for you.

7
Install PostgreSQL
  • Check the Init. Database cluster box.
  • Choose UTF8 for the character sets.
  • Select a database password you will remember and
    click next.

8
Install PostgreSQL
  • Check the PL/pgsql box.
  • Click next.

9
Install PostgreSQL
  • Add the GiST index option (These are the spatial
    indexes).
  • Click next.

10
Install PostgreSQL
  • Click next and wait while PostgreSQL installs

11
Install PostgreSQL
  • Uncheck the Launch Stack Builder at exit. The
    Stack Builder allows you to install addins to
    PostgreSQL by downloading them off the web.
    PostGIS is in this list but I have already
    downloaded it for you so we dont kill the
    wireless.
  • Click Finish

12
Install PostGIS
  • From the CD run the PostGIS installer.

13
Install PostGIS
  • From the CD run the PostGIS installer.
  • I agree, Next, Next, Next

14
Install PostGIS
  • Enter the database password you selected when you
    installed Postgres and click next.

15
Install PostGIS
  • Accept the default database name.
  • Click Install.
  • Wait.

16
Load Data into PostGIS
  • Open a command line to gain access to the shape
    file importer
  • Start-gtAll Programs-gtPostgreSQL 8.3-gtCommand
    Prompt

17
Load Data into PostGIS
  • Run shp2pgsql.exe help to see the list of
    options.
  • Load the data

18
Load Data into PostGIS
  • Shp2pgsql.exe I D d\monuments\mouments.shp
    monuments psql postgis postgres
  • Command Name Shp2pgsql.exe
  • Command Options -I D (that is a captial i)?
  • This means create a spatial index
  • Load using dump format (faster)?
  • The path to the shape file
  • The table name to load the file into.
  • The pipe () send the output of shp2pgsql to
    psql
  • Psql the command line sql client for PostgreSQL
  • Postgis the database you want to load the shape
    file into.
  • Postgres the username to connect to the database
    with.

Shp2pgsql.exe I D c\ms4w\apps\GeoMOOSE\maps_cou
ntydemo\monuments\monuments.shp monuments psql
postgis postgres
19
Load Data into PostGIS
  • Type the command and enter your database password.

20
Look at the Data
  • Open pgAdmin III
  • Start-gtAll Programs-gtPostgreSQL 8.3-gtpgAdmin III
  • If it is not there already click the plug to
    connect to your database.

21
Look at the Data
  • Open pgAdmin III
  • Start-gtAll Programs-gtPostgreSQL 8.3-gtpgAdmin III
  • If it is not there already click the plug to
    connect to your database.

22
Look at the Data
  • Expand the tree down to the monuments table

23
Look at the Data
  • Click the view table button

24
Look at the Data
  • Close table preview window and click the SQL
    button

25
Look at the Data
  • Run the following SQL.
  • select astext(the_geom), from monuments
  • Using astext you can see the points as text.

26
View the data in Moose
  • Edit the monuments map file to change the data
    source.

27
View the data in Moose
  • Same thing for identify.map

28
View the data in Moose
  • A quirk postgres uses lower case attribute
    names, shape files are upper case. We need to fix
    this in the monuments_identify.html file.

29
Edit the data with QGIS
  • Install QGIS
  • Connect to the PostGIS data source
  • Edit data

30
Install QGIS
  • Launch the QGIS installer on the CD
  • Click Next, I agree, Next, Next, Install
  • Wait

31
Connect to the Data
  • Launch QGIS (Start-gtAll Programs-gtQuantum
    GIS-gtQuantumGIS)?

32
Connect to the Data
  • Click the connect to DB source button

33
Connect to the Data
  • Click New

34
Connect to the Data
  • Enter the connection parameters
  • Click Test Connect
  • Click Ok

35
Connect to the Data
  • Click Connect

36
Connect to the Data
  • Click Select the layer and click add

37
Connect to Data
  • You should now have something like this

38
Connect to Data
  • Click Toggle Editing

39
Connect to Data
  • Click the digitize point tool

40
Connect to Data
  • Click on the map to add a point

41
Connect to Data
  • Fill in the attributes, click OK

42
Connect to Data
  • Click Toggle Editing to save changes

43
Look for your point in Moose
44
Documentation
  • http//www.posgresql.org
  • http//postgis.refractions.net/documentation/manua
    l-1.3/
  • http//www.qgis.org
  • http//mapserver.gis.umn.edu
Write a Comment
User Comments (0)
About PowerShow.com