[Mapserver-users] CGI extent defined in lat/lon
Thomas Chesky
thomaschesky at yahoo.com
Mon Jul 19 14:08:33 PDT 2004
--0-2008529837-1090271313=:23256
Content-Type: text/plain; charset=us-ascii
Hello,
I have a USGS DOQ showing a section of San Francisco. I know the lat/lon boudaries
and would like to request an image from mapserver to return sf street lines for the same extent and in the same projection.
The USGS image is coming from a different legacy app, so I am not planning to integrate that layer into mapserver, but I'd like to produce a matching vector layer.
The problem I have is the following:
I can reproject (via the map file) the vector layer to the desired projection, epsg:4326
but I have hard time defining the same extent via the CGI interface.
shpinfo gives me an extent of the street lines, I believe in UTM
I can use that metrics to pass in MAPEXT CGI param and get the proper image, but if I use lat/lon extent (left bottom pair followed by right top pair) I get blank image.
I tried it by removing the extent from the map file, settings UNITS DD etc.
nothing worked but I am pretty sure, that I have the right lat/lon extent (should overlap the extent of the shape file)
To generalize it further, I'd like to know if one can pass in lat/lon extent as cgi param even though the original shp extent is in UTM. Also, when I converted the lat/lons to UTM I got an extent with northing 4179967.999999912 to 4183167.9999999166 , while the same extent revealed by shpinfo is in the range of 2110000 to 2114000, which looks like some other metrics.
I am not GIS educated so I might badly misuse some terms :-)
My goal seems to be pretty simple so I probably miss some obvious here.
Please advise if you may..
Thanks -- Tom
Here is my map file:
MAP
IMAGETYPE PNG24
EXTENT 5975000 2110000 6000000 2114000
#EXTENT -123.113714 37.691039 -122.355778 37.930881
SIZE 600 400
SHAPEPATH "data"
IMAGECOLOR 255 255 255
FONTSET "fonts/fonts.list"
PROJECTION
"init=epsg:4326"
END
# Start of LAYER DEFINITIONS ---------------------------------------------
LAYER
NAME street_lines
DATA stclines
STATUS DEFAULT
TYPE LINE
CLASS
COLOR 212 212 212
OUTLINECOLOR 212 212 212
END
END
LAYER
NAME street_label
DATA stclines
STATUS DEFAULT
TYPE ANNOTATION
LABELITEM "STREET"
CLASS
COLOR 255 255 255
LABEL
COLOR 1 1 1
TYPE TRUETYPE
FONT arial
SIZE 6
ANTIALIAS TRUE
POSITION AUTO
ANGLE AUTO
PARTIALS FALSE
MINDISTANCE 300
BUFFER 4
END # end of label
END
END
# End of LAYER DEFINITIONS -------------------------------
END # end of map file/object
---------------------------------
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
--0-2008529837-1090271313=:23256
Content-Type: text/html; charset=us-ascii
<DIV>Hello,</DIV>
<DIV>I have a USGS DOQ showing a section of San Francisco. I know the lat/lon boudaries<BR>and would like to request an image from mapserver to return sf street lines for the same extent and in the same projection.</DIV>
<DIV> </DIV>
<DIV>The USGS image is coming from a different legacy app, so I am not planning to integrate that layer into mapserver, but I'd like to produce a matching vector layer.</DIV>
<DIV> </DIV>
<DIV>The problem I have is the following:</DIV>
<DIV><BR>I can reproject (via the map file) the vector layer to the desired projection, epsg:4326<BR>but I have hard time defining the same extent via the CGI interface.</DIV>
<DIV>shpinfo gives me an extent of the street lines, I believe in UTM</DIV>
<DIV> </DIV>
<DIV>I can use that metrics to pass in MAPEXT CGI param and get the proper image, but if I use lat/lon extent (left bottom pair followed by right top pair) I get blank image.</DIV>
<DIV> </DIV>
<DIV>I tried it by removing the extent from the map file, settings UNITS DD etc.<BR>nothing worked but I am pretty sure, that I have the right lat/lon extent (should overlap the extent of the shape file) </DIV>
<DIV> </DIV>
<DIV>To generalize it further, I'd like to know if one can pass in lat/lon extent as cgi param even though the original shp extent is in UTM. Also, when I converted the lat/lons to UTM I got an extent with northing 4179967.999999912 to 4183167.9999999166 , while the same extent revealed by shpinfo is in the range of 2110000 to 2114000, which looks like some other metrics.</DIV>
<DIV> </DIV>
<DIV>I am not GIS educated so I might badly misuse some terms :-)<BR></DIV>
<DIV>My goal seems to be pretty simple so I probably miss some obvious here.</DIV>
<DIV> </DIV>
<DIV>Please advise if you may..</DIV>
<DIV> </DIV>
<DIV>Thanks -- Tom</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Here is my map file:</DIV>
<DIV>MAP<BR> IMAGETYPE PNG24</DIV>
<DIV> EXTENT 5975000 2110000 6000000 2114000<BR> #EXTENT -123.113714 37.691039 -122.355778 37.930881<BR> <BR> SIZE 600 400<BR> SHAPEPATH "data"</DIV>
<DIV> IMAGECOLOR 255 255 255</DIV>
<DIV> FONTSET "fonts/fonts.list"</DIV>
<DIV> PROJECTION<BR> "init=epsg:4326"<BR> END</DIV>
<DIV> # Start of LAYER DEFINITIONS ---------------------------------------------</DIV>
<DIV> LAYER <BR> NAME street_lines<BR> DATA stclines<BR> STATUS DEFAULT<BR> TYPE LINE<BR> CLASS<BR> COLOR 212 212 212<BR> OUTLINECOLOR 212 212 212 <BR> END</DIV>
<DIV> END </DIV>
<DIV> LAYER <BR> NAME street_label<BR> DATA stclines<BR> STATUS DEFAULT<BR> TYPE ANNOTATION</DIV>
<DIV><BR> LABELITEM "STREET"<BR> CLASS<BR> COLOR 255 255 255<BR> LABEL<BR> COLOR 1 1 1<BR> TYPE TRUETYPE<BR> FONT arial<BR> SIZE 6<BR> ANTIALIAS TRUE<BR> POSITION AUTO<BR> ANGLE AUTO<BR> PARTIALS FALSE<BR> MINDISTANCE 300<BR> BUFFER
4<BR> END # end of label</DIV>
<DIV> END <BR> END</DIV>
<DIV> </DIV>
<DIV> # End of LAYER DEFINITIONS -------------------------------</DIV>
<DIV>END # end of map file/object</DIV>
<DIV><BR> </DIV><p>
<hr size=1>Do you Yahoo!?<br>
<a href="http://advision.webevents.yahoo.com/yahoo/votelifeengine/">Vote for the stars of Yahoo!'s next ad campaign!</a>
--0-2008529837-1090271313=:23256--
More information about the MapServer-users
mailing list