Re: [mapserver-users] many raster projections

2010-02-09 Thread Andy Colson

On 2/8/2010 1:31 PM, Fawcett, David (MPCA) wrote:

Andy,

Assuming that MapServer can find the data, the main reason that you
wouldn't see any data for the layer is that it doesn't fall within
the output extent bbox.  (To rule out any data issues, you could
create a second map file with no projection info and only your 07
layer.  Run gdalinfo against the 07 data and use the bbox info to set
your map file extent)

What do you see if you run the gdalinfo utility against the data (or
one of your tiles) from raster07?
the gdalinfo is impressively long, here is the parts that I think are 
important:


Size is 48980, 49445
Coordinate System is:
PROJCS[NAD83 / UTM zone 15N,
GEOGCS[NAD83,
DATUM[North_American_Datum_1983,
SPHEROID[GRS 1980,6378137,298.2572221010002,
AUTHORITY[EPSG,7019]],
AUTHORITY[EPSG,6269]],
PRIMEM[Greenwich,0],
UNIT[degree,0.0174532925199433],
AUTHORITY[EPSG,4269]],
PROJECTION[Transverse_Mercator],
PARAMETER[latitude_of_origin,0],
PARAMETER[central_meridian,-93],
PARAMETER[scale_factor,0.9996],
PARAMETER[false_easting,50],
PARAMETER[false_northing,0],
UNIT[metre,1,
AUTHORITY[EPSG,9001]],
AUTHORITY[EPSG,26915]]
Origin = (429904.000,4428374.000)

Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  429904.000, 4428374.000) ( 93d49'16.36W, 40d 0'9.53N)
Lower Left  (  429904.000, 4378929.000) ( 93d48'57.36W, 39d33'25.87N)
Upper Right (  478884.000, 4428374.000) ( 93d14'50.62W, 40d 0'19.05N)
Lower Right (  478884.000, 4378929.000) ( 93d14'44.90W, 39d33'35.25N)
Center  (  454394.000, 4403651.500) ( 93d31'57.31W, 39d46'53.71N)


my mapfile has: MAP EXTENT 1285920 1377857 1426390 1506589

so, yeah, the origin is not within the bbox.  On an image that works, it 
has:


Origin = (1329809.95399910593,1463071.94800091270)

which looks to be within the bbox.  So how do I get the arial moved? 
Why didnt putting the projection in the raster layer (or running 
gdal_translate or gdal_warp) move it into the right bbox?




Does the spatial reference system
match what you thought that it was?


Huh?  Does spatial reference system == projection == Coordinate 
System?  I dont know...





It looks like the definition for your output projection does match
epsg:2816.  http://spatialreference.org/ref/epsg/2816/

If you look at the extent that you are setting in your map file (in
coordinates of epsg:2816), you aren't covering the southern part of
the zone.  Did you base your extent on the entire area that you need
to cover?
I got the bounds from a shapefile, its the largest one and covers 
everything I want to display.  See the ogrinfo below.





Also, you have UNITS set to feet, but your output projection has
'+units=m'. I would set units to METERS.



Well crap.


 ogrinfo -so countyBoundary.shp countyBoundary
INFO: Open of `countyBoundary.shp'
  using driver `ESRI Shapefile' successful.

Layer name: countyBoundary
Geometry: Polygon
Feature Count: 1
Extent: (1285920.182293, 1377857.531376) - (1426390.260458, 1506589.406771)
Layer SRS WKT:
PROJCS[NAD_1983_StatePlane_Missouri_Central_FIPS_2402_Feet,
GEOGCS[GCS_North_American_1983,
DATUM[North_American_Datum_1983,
SPHEROID[GRS_1980,6378137.0,298.257222101]],
PRIMEM[Greenwich,0.0],
UNIT[Degree,0.0174532925199433]],
PROJECTION[Transverse_Mercator],
PARAMETER[False_Easting,1640416.7],
PARAMETER[False_Northing,0.0],
PARAMETER[Central_Meridian,-92.5],
PARAMETER[Scale_Factor,0.],
PARAMETER[Latitude_Of_Origin,35.84],
UNIT[Foot_US,0.3048006096012192]]
NAME: String (50.0)
SHAPE_Leng: Real (19.11)
SHAPE_Area: Real (19.11)


That means its in feet, right?  Both my mapfile and OpenLayers are using:
+proj=tmerc +lat_0=35.84 +lon_0=-92.5 +k=0.3 
+x_0=50 +y_0=0 +ellps=GRS80 +units=m +no_defs


Does that mean mapserver is reprojecting to meters... thats probably why 
OpenLayers can show it, right?  The output of mapserver is meters and 
OpenLayers is expecting meters.  So that's not really bad, right?  But 
if I reproject the shapefiles it'll save me some cpu time, yes?


Would this affect the arials?


Thank you very much with the help on this.

-Andy
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] many raster projections

2010-02-08 Thread Andy Colson
Ok, I'm confused.  Most of the problem is probably because I'm a 
programmer, not a mapper.


I have arial imagery of Minnesota, multiple sets, each seeming to be in 
a different projection.


At the top of my mapfile I have this:

MAP
  EXTENT 1285920 1377857 1426390 1506589

  PROJECTION
+proj=tmerc +lat_0=35.84 +lon_0=-92.5 +k=0.3 
+x_0=50 +y_0=0 +ellps=GRS80 +units=m +no_defs

  END

There are no other PROJECTION settings.  Most of the images seem to 
work.  I got the projtext above from loading one of the shapefiles into 
qgis and looking at its properties.  I just kinda hoped they'd all be 
the same.  I did try adding a PROJECTION to the raster layer, but it 
didnt seem to work.  So I thought I'd just re-project the imagery.



Three sets of imagery seem to work (I didnt touch them, they always 
worked), they have (again copied from qgis) proj text's of:


+proj=tmerc +lat_0=35.84 +lon_0=-92.5 +k=0.3 
+x_0=50.01 +y_0=0 +ellps=GRS80 +datum=NAD83 
+to_meter=0.3048006096012192 +no_defs


+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

and

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

One set is displayed way off the map, way far away from where its 
supposed to be.  Its projtext is:


+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs

I attempted to use gdal_translate and gdal_warp.

gdal_translate made a new image, with projtext:
+proj=tmerc +lat_0=35.84 +lon_0=-92.5 +k=0.3 
+x_0=50 +y_0=0 +ellps=GRS80 +units=m +no_defs


but its in the exact same spot, it didnt re-position to where images are 
supposed to be.


A gdalwarp moved it, but not to the right place.

So I'm confused, and not sure what I'm doing.  Hopefully there is some 
info in here someone can use to set me on the right path.  Any help 
would be appreciated.


-Andy
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] many raster projections

2010-02-08 Thread Fawcett, David (MPCA)
Andy, 

It looks like you have data in at least two or three different projections.  If 
you want to display them in the same map using MapServer, you need:

- a projection block at the MAP level.  This defines your output projection.  
The map UNITS and EXTENT need tobe consistent with this projection.  

- a projection block for each layer.  This is used to tell MapServer what 
projection the data for that layer is currently in.  

MapServer then uses this info to warp all of the layers into the same output 
projection.  

Does this help?  

Are these all publicly available datasets?

David.



-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Andy Colson
Sent: Monday, February 08, 2010 10:11 AM
To: mapserver-users
Subject: [mapserver-users] many raster projections

Ok, I'm confused.  Most of the problem is probably because I'm a 
programmer, not a mapper.

I have arial imagery of Minnesota, multiple sets, each seeming to be in 
a different projection.

At the top of my mapfile I have this:

MAP
   EXTENT 1285920 1377857 1426390 1506589

   PROJECTION
 +proj=tmerc +lat_0=35.84 +lon_0=-92.5 +k=0.3 
+x_0=50 +y_0=0 +ellps=GRS80 +units=m +no_defs
   END

There are no other PROJECTION settings.  Most of the images seem to 
work.  I got the projtext above from loading one of the shapefiles into 
qgis and looking at its properties.  I just kinda hoped they'd all be 
the same.  I did try adding a PROJECTION to the raster layer, but it 
didnt seem to work.  So I thought I'd just re-project the imagery.


Three sets of imagery seem to work (I didnt touch them, they always 
worked), they have (again copied from qgis) proj text's of:

+proj=tmerc +lat_0=35.84 +lon_0=-92.5 +k=0.3 
+x_0=50.01 +y_0=0 +ellps=GRS80 +datum=NAD83 
+to_meter=0.3048006096012192 +no_defs

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

and

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

One set is displayed way off the map, way far away from where its 
supposed to be.  Its projtext is:

+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs

I attempted to use gdal_translate and gdal_warp.

gdal_translate made a new image, with projtext:
+proj=tmerc +lat_0=35.84 +lon_0=-92.5 +k=0.3 
+x_0=50 +y_0=0 +ellps=GRS80 +units=m +no_defs

but its in the exact same spot, it didnt re-position to where images are 
supposed to be.

A gdalwarp moved it, but not to the right place.

So I'm confused, and not sure what I'm doing.  Hopefully there is some 
info in here someone can use to set me on the right path.  Any help 
would be appreciated.

-Andy
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] many raster projections

2010-02-08 Thread Andy Colson

Thank you, but that didnt seem to help.

I left the main PROJECTION as is, and I changed my raster to this:

LAYER
NAME raster07
STATUS off
TILEINDEX raster07.shp
TILEITEM location
TYPE RASTER
PROJECTION
+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs
END
END


Now, here's another problem (to add to the layers of projections).  I'm 
using OpenLayers on the front end (for the website), and I have no idea 
what all this projection stuff means, and wasnt sure how to set it in 
OpenLayers.


I create the map like this:

map = new OpenLayers.Map(map, {
controls: [
new OpenLayers.Control.Navigation( {zoomWheelEnabled: false} ),
new OpenLayers.Control.PanZoomBar(),
ls
],
numZoomLevels: 12,
maxExtent: new OpenLayers.Bounds([%minx%], [%miny%], [%maxx%], 
[%maxy%]),
maxResolution: 250,
unit: 'm',
projection: EPSG:2816}
);

It seems to work.  I totally guessed at EPSG:2816, I have no idea if it 
matches:
+proj=tmerc +lat_0=35.84 +lon_0=-92.5 +k=0.3 
+x_0=50 +y_0=0 +ellps=GRS80 +units=m +no_defs


The shapefiles show up, as do most of the arials.

 Are these all publicly available datasets?

I dont know, they are from the Livingston county Missouri Assessors 
office.  Hum... did I say Minnesota before?  That was wrong, its MO not 
MN.  Its about 2 gig, and I could email and ask them if it really comes 
down to it.


-Andy

On 2/8/2010 10:36 AM, Fawcett, David (MPCA) wrote:

Andy,

It looks like you have data in at least two or three different
projections.  If you want to display them in the same map using
MapServer, you need:

- a projection block at the MAP level.  This defines your output
projection.  The map UNITS and EXTENT need tobe consistent with this
projection.

- a projection block for each layer.  This is used to tell MapServer
what projection the data for that layer is currently in.

MapServer then uses this info to warp all of the layers into the same
output projection.

Does this help?

Are these all publicly available datasets?

David.



-Original Message- From:
mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Andy
Colson Sent: Monday, February 08, 2010 10:11 AM To: mapserver-users
Subject: [mapserver-users] many raster projections

Ok, I'm confused.  Most of the problem is probably because I'm a
programmer, not a mapper.

I have arial imagery of Minnesota, multiple sets, each seeming to be
in a different projection.

At the top of my mapfile I have this:

MAP EXTENT 1285920 1377857 1426390 1506589

PROJECTION +proj=tmerc +lat_0=35.84 +lon_0=-92.5
+k=0.3 +x_0=50 +y_0=0 +ellps=GRS80 +units=m +no_defs
END

There are no other PROJECTION settings.  Most of the images seem to
work.  I got the projtext above from loading one of the shapefiles
into qgis and looking at its properties.  I just kinda hoped they'd
all be the same.  I did try adding a PROJECTION to the raster layer,
but it didnt seem to work.  So I thought I'd just re-project the
imagery.


Three sets of imagery seem to work (I didnt touch them, they always
worked), they have (again copied from qgis) proj text's of:

+proj=tmerc +lat_0=35.84 +lon_0=-92.5 +k=0.3
+x_0=50.01 +y_0=0 +ellps=GRS80 +datum=NAD83
+to_meter=0.3048006096012192 +no_defs

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

and

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

One set is displayed way off the map, way far away from where its
supposed to be.  Its projtext is:

+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs

I attempted to use gdal_translate and gdal_warp.

gdal_translate made a new image, with projtext: +proj=tmerc
+lat_0=35.84 +lon_0=-92.5 +k=0.3 +x_0=50
+y_0=0 +ellps=GRS80 +units=m +no_defs

but its in the exact same spot, it didnt re-position to where images
are supposed to be.

A gdalwarp moved it, but not to the right place.

So I'm confused, and not sure what I'm doing.  Hopefully there is
some info in here someone can use to set me on the right path.  Any
help would be appreciated.

-Andy ___ mapserver-users
mailing list mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] many raster projections

2010-02-08 Thread Andy Colson
To take OpenLayers out of the equation, I made myself a test.map file 
that just included two layers and used shp2img.


If I switch on the 2007 (raster07) then I get no arial (the result image 
is just a gray slate).


If I switch on raster09_chil, the result image has the arial's as expected.


Hopefully the attachment will make it through.

-Andy



On 2/8/2010 11:05 AM, Andy Colson wrote:

Thank you, but that didnt seem to help.

I left the main PROJECTION as is, and I changed my raster to this:

LAYER
NAME raster07
STATUS off
TILEINDEX raster07.shp
TILEITEM location
TYPE RASTER
PROJECTION
+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs
END
END


Now, here's another problem (to add to the layers of projections). I'm
using OpenLayers on the front end (for the website), and I have no idea
what all this projection stuff means, and wasnt sure how to set it in
OpenLayers.

I create the map like this:

map = new OpenLayers.Map(map, {
controls: [
new OpenLayers.Control.Navigation( {zoomWheelEnabled: false} ),
new OpenLayers.Control.PanZoomBar(),
ls
],
numZoomLevels: 12,
maxExtent: new OpenLayers.Bounds([%minx%], [%miny%], [%maxx%], [%maxy%]),
maxResolution: 250,
unit: 'm',
projection: EPSG:2816}
);

It seems to work. I totally guessed at EPSG:2816, I have no idea if it
matches:
+proj=tmerc +lat_0=35.84 +lon_0=-92.5 +k=0.3
+x_0=50 +y_0=0 +ellps=GRS80 +units=m +no_defs

The shapefiles show up, as do most of the arials.

  Are these all publicly available datasets?

I dont know, they are from the Livingston county Missouri Assessors
office. Hum... did I say Minnesota before? That was wrong, its MO not
MN. Its about 2 gig, and I could email and ask them if it really comes
down to it.

-Andy

On 2/8/2010 10:36 AM, Fawcett, David (MPCA) wrote:

Andy,

It looks like you have data in at least two or three different
projections. If you want to display them in the same map using
MapServer, you need:

- a projection block at the MAP level. This defines your output
projection. The map UNITS and EXTENT need tobe consistent with this
projection.

- a projection block for each layer. This is used to tell MapServer
what projection the data for that layer is currently in.

MapServer then uses this info to warp all of the layers into the same
output projection.

Does this help?

Are these all publicly available datasets?

David.



-Original Message- From:
mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Andy
Colson Sent: Monday, February 08, 2010 10:11 AM To: mapserver-users
Subject: [mapserver-users] many raster projections

Ok, I'm confused. Most of the problem is probably because I'm a
programmer, not a mapper.

I have arial imagery of Minnesota, multiple sets, each seeming to be
in a different projection.

At the top of my mapfile I have this:

MAP EXTENT 1285920 1377857 1426390 1506589

PROJECTION +proj=tmerc +lat_0=35.84 +lon_0=-92.5
+k=0.3 +x_0=50 +y_0=0 +ellps=GRS80 +units=m +no_defs
END

There are no other PROJECTION settings. Most of the images seem to
work. I got the projtext above from loading one of the shapefiles
into qgis and looking at its properties. I just kinda hoped they'd
all be the same. I did try adding a PROJECTION to the raster layer,
but it didnt seem to work. So I thought I'd just re-project the
imagery.


Three sets of imagery seem to work (I didnt touch them, they always
worked), they have (again copied from qgis) proj text's of:

+proj=tmerc +lat_0=35.84 +lon_0=-92.5 +k=0.3
+x_0=50.01 +y_0=0 +ellps=GRS80 +datum=NAD83
+to_meter=0.3048006096012192 +no_defs

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

and

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

One set is displayed way off the map, way far away from where its
supposed to be. Its projtext is:

+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs

I attempted to use gdal_translate and gdal_warp.

gdal_translate made a new image, with projtext: +proj=tmerc
+lat_0=35.84 +lon_0=-92.5 +k=0.3 +x_0=50
+y_0=0 +ellps=GRS80 +units=m +no_defs

but its in the exact same spot, it didnt re-position to where images
are supposed to be.

A gdalwarp moved it, but not to the right place.

So I'm confused, and not sure what I'm doing. Hopefully there is
some info in here someone can use to set me on the right path. Any
help would be appreciated.

-Andy ___ mapserver-users
mailing list mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


MAP
NAME LivingstonMO
SIZE 800 800
UNITS feet
SHAPEPATH '/pub/maps/LivingstonMO/shape'
FONTSET /pub/www/fonts/fonts.txt

EXTENT 1285920