[Ottawa_users] New Brunswick User looking for help with GRASSand Quantum GIS - may be of interest to new users

Sampson, David dsampson at NRCan.gc.ca
Wed Jan 23 08:55:58 EST 2008


I'll try to hit a few points. I don't have all the answers to your questions, but they will certainly come in time.

I am a strong supporter of getting people into the GIS game without the overhead costs of licensing. Lots of groups out there to help. I am currently working with a local Search and Rescue Group to try and help them out. Interesting challenges.

The first part it sounds like you're trying to do is get your location set up. You have tripped across the most common barrier when exchanging data files from disparate sources. They are either in conflicting projections or datums. 

Good on yhea for finding ogr2ogr. The OGR mailing list has helped me out with a lot of challenges and maybe a few folks here might have something to say. I do encourage the OGR mailing list, they are quite helpful. It looks like you have the general idea and assume you've looked at the syntax. Errors are good if you know what they mean. Try googling results of the errors against the mailing list archieves or the internet in general. Copy past of errors often turn up little gems. One way to think of it is that in most cases someone has experienced the same thing and it is already documented.

There is another approach you could try. Import like datasets into like locations. Then use the reproject function to reproject datasets in one location to a matching location. http://download.osgeo.org/grass/grass63/manuals/html63_user/v.proj.html  for the GUI try looking under the vector functions.  This might be easier to figure out that ogr2ogr if the command line gives you trouble.  Also you should be able to see the command is created under GRASS that might help future command line use using ogr2ogr.

For neighbour analysis check out
http://download.osgeo.org/grass/grass63/manuals/html63_user/v.neighbors.html
http://download.osgeo.org/grass/grass63/manuals/html63_user/r.neighbors.html


When you import SHP files using the OGR tool the DBF also gets imported
http://download.osgeo.org/grass/grass63/manuals/html63_user/v.in.ogr.html

If you just have a DBF file or DB connections with spatial info you want to bring into GRASS then check this out
http://download.osgeo.org/grass/grass63/manuals/html63_user/v.in.db.html

If you want to import attribute Database info check out 
http://download.osgeo.org/grass/grass63/manuals/html63_user/db.in.ogr.html

Not that this is part of your challenge but something I just learned researching your query is that GRASS (through OGR) now supports import and export of KML. Now you can share results in google earth and google maps. (just an aside)
http://download.osgeo.org/grass/grass63/manuals/html63_user/v.out.ogr.html
http://www.gdal.org/ogr/drv_kml.html


Remember, when in doubt the manual is your friend. I like the onlione version because it is searchable
http://download.osgeo.org/grass/grass63/manuals/html63_user/index.html

I hope some of these help...

Cheers




-----Original Message-----
From: ottawa_users-bounces at lists.osgeo.org [mailto:ottawa_users-bounces at lists.osgeo.org] On Behalf Of Alyre Chiasson
Sent: Tuesday, January 22, 2008 16:48
To: Ottawa (Canada) Local Chapter List
Subject: Re: [Ottawa_users] New Brunswick User looking for help with GRASSand Quantum GIS - may be of interest to new users

Hello all,

Thanks for all the offers of help and the suggestion to do an initial post. Perhaps a quick explanation of what I am attempting to do would be in order as well as what resources I have on hand. I have the book, "Open Source GIS: A GRASS GIS Approach" by Netler and Mitasova (second edition, and I just got the third yesterday) and have printed out an "Introduction to the practical use of the Free Geographical Information System GRASS 6.0," so you can point me to specific pages that might be of help that I may have overlooked.

I have a bunch of shape files from Environment Canada with predicted maximum air temperature increases for New Brunswick (they are actually of the whole Atlantic Region from what I can see) in 30 year blocks to 2100 (Dataset A). They do have "prj" files. Example:

GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]

They come up as isotherms (contour lines) and are labeled; the labels are in a dbf file.

I also have shapefiles for the rivers and streams in New Brunswick, including (site/point) data with watercourse names (Dataset B). They also have "prj" files. They also include basic boundaries to the province. Again, here is the prj file.


GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]

I also have data on mean maximum water temperatures for various rivers across New Brunswick (Dataset C). They are current in an Excel spreadsheet and have the following format:


CoordinateSystem XCoordinate YCoordinate CoordinateUnits
NAD83 (CSRS) NB Stereographic 2394846.697 7657396.666 Meters


I also have upper lethal temperature data for most of the freshwater fish of New Brunswick. You can get predicted water temperatures by multiplying air temperature by 0.9 and adding it to the base water temperature. The idea would be for each site where baseline water temperatures are known, the nearest isotherm would be chosen and the predicted increase for that site calculated and labeled. I was also hoping to be able to superimpose on this a layer that would flag temperatures above a certain value. For example, if it happened to be Atlantic salmon, there would be a red dot above 24 C. Increasing red dots over time would means progressive loss of the species (main point of the exercise).

I also bought a copy of NBGEOCALC from Services New Brunswick, which they describe as:

NBGeocalc is a piece of software designed by SNB to help with coordinate conversions and transformations in New Brunswick. It is the accepted standard for transforming coordinates from/to ATS77 and NAD83 (CSRS). It is also a very useful tool to convert in all directions, latitudes / longitudes and UTM coordinates

I figure I might get some water temperature data from sports clubs but in lat and long.

 From the provincial web site I found that the province uses something called NAD83 (CSRS) Double Sterographic, a screen capture of parameters is attached (image2). I have also found that this corresponds to EPSG code 2953. Out of this I see two options:

1) Stick with NAD83 of datasets A and B and use GEOCALC to translate the coordinates of dataset 3. Other than being compatible with the province and I don't know what the advantage of Double Stereographic is and maybe it does not make a difference for what I want to do.

2) The other option is to covert dataset A and B (shapefiles) and creates a LOCATION and mapset based on a Double Stereographic Projection. I have created a LOCATION using EPSG code 2953 and get the following output from g.proj.

PROJCS["Stereographic",
GEOGCS["unnamed",
DATUM["unknown",
SPHEROID["unnamed",6378137,298.257222101]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]],
PROJECTION["Oblique_Stereographic"],
PARAMETER["latitude_of_origin",46.5],
PARAMETER["central_meridian",-66.5],
PARAMETER["scale_factor",0.999912],
PARAMETER["false_easting",2500000],
PARAMETER["false_northing",7500000],
UNIT["metre",1]]

My first concerns are the "unkown"s and the second is that the projection is listed as "Oblique Sterographic" and not "Double". Maybe "Oblique" is actually a "Stero" projection? Somewhat disconcerting for someone starting out. I confirmed the EPSG code from: 
http://spatialreference.org/ref/epsg/2953/

I am also confused as to what kind of coordinate system is being used above (Double Sterographic). Seems like a form of UTM? As a question, if I was to create the LOCATION from scratch based on UTM, how would I go about representing New Bruswick as a LOCATION that actually physically lies within 2 UTM zones? All of the examples that create LOCATIONs based on UTM that I have seen so far are silent on what you do if your LOCATION covers more than one zone. Can you actually query across two LOCATIONs, is that the solution? So what are "Sterographic" coordinates, does everything become the equivalent of a single zone and the projection corrects for errors involved in extrapolating for what would be otherwise traversing from one zone to another?

Assuming that everything above is okay I grasp that I need to reproject the shape files and convert the coordinate system. By example, I have a shape file called nbmjwatr.shp and its associated prj file (first example above). From what I have read so far the conversion can be done with org2org. I am not sure what the command would be, I can't find an example where the particular prj files is specified or is it automatically read if it is in the same directory? So would the command be

org2org nbmjwatr.shp \ -spat -60.05 35.00 -63.78 48.07 \ my_nbmjwatr.shp

?

The -spat is to cut out the boundaries to fit my the EPSG 2953 specified boundaries.

I have tried something similar and got a string of errors saying I needed to provide the transformation information. I may just have the wrong command. If I extract this from the top prj file above, would the following do the job

org2org -a_srs '+proj=latlong +ellps= GRS80 +datumn=NAD83' \ -spat
-60.05 35.00 -63.78 48.07 \ my_nbmjwatr.shp nbmjwatr.shp

?

I assume the dbf file gets imported as well. What happens to the labels which are in the dbf file? In the original shapefiles from Environment Canada the labels are missing from the upper part of New Brunswick because in the original they are over Nova Scotia (image1). Will the labels be readjusted when the original file gets clipped? I can't fine anything on how label placement is determined. However, the first hurdle is getting the basic maps into GRASS because I don't think Quantum can do the above.

I don't know if GRASS can do the nearest neighbour isotherm type of calculation I have proposed above with some king of script but I will be doing more reading or you can suggest where I might look. Unless Quantum would be an easier tool to do the above, I wanted to use it mainly as a viewer for the resulting product.

I may be well over my head here but part of this was to see how difficult the whole business would be. The Open Source approach was in part because of my involvement with watershed groups that can't afford commercial GIS software but could profit from using GIS to look at their data. My best course of action may be to hire someone to actually get the work done first (priority) and I try to duplicate it with GRASS or Quantum on my part. I get blank stares here when I mention either GRASS or Quantum or anything Linux so it would be alternative GIS software if I was to hire someone.

Just as background I am a biology professor of 20 years in a relatively small university (Université de Moncton), in New Brunswick. So I guess I am somewhat of an old dog trying to learn new things. The Apple IIe came out when I was doing my doctorate :) and I actually cut my first teeth on a Unix system so command lines don't bother me.

Thanks in advance for any suggestions/advice or help you care to offer. 
If this is not of general interest I can carry on by email with anyone that might want to help a somewhat lost soul. I guess, I am a good example of someone coming from outside of the specific field of GIS.

Thanks

Alyre



More information about the Ottawa_users mailing list