[Mapserver-users] Serving PostGIS Projected Data

Benjamin Wragg bwragg at tpg.com.au
Mon Jun 16 14:57:42 PDT 2003


This is a multi-part message in MIME format.

------=_NextPart_000_000F_01C334A1.F1E79190
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi list,

 

With my limited use of PostGIS and MapServer I've only ever played
around with data in geographic coordinates which is loaded into PostGIS
with an SRID of -1. I now need to load up some data that is in a custom
Mercator projection (changed the central meridian to 150 instead of 0).
The SRID number of our custom projection in the spatial_ref_sys table is
999001 which is based on the record with an SRID of 54004. The proj4text
for 999001 looks like "+proj=merc +lat_ts=0 +lon_0=150 +k=1.000000
+x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 units=m". When I load up the
data, each record has an SRID of 999001.

 

Is this all I need to do on the PostGIS side of things?

 

I've now added the layer to a bare mapfile but the data is showing up
like it would with a -1 srid. I have no projection information of any
sort defined in the mapfile so I assume I need to define a PROJECTION
section in the mapfile. Correct?

 

How do I do this for a custom projection? I've found examples on the
list like the following which show how to enter the projection section
in a mapfile, but I can't figure out what I should put in here.

 

PROJECTION
  "proj=lcc"
  "ellps=GRS80"
  "lat_0=49"
  "lon_0=-95"
  "lat_1=49"
  "lat_2=77"
END
 

 

Thanks,

 

Benjamin Wragg


------=_NextPart_000_000F_01C334A1.F1E79190
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">


<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">

<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
pre
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Courier New";}
span.emailstyle17
	{font-family:Arial;
	color:windowtext;}
span.EmailStyle19
	{font-family:Arial;
	color:navy;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-AU link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hi list,</span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>With my limited use of PostGIS and MapServer =
I’ve only
ever played around with data in geographic coordinates which is loaded =
into
PostGIS with an SRID of -1. I now need to load up some data that is in a =
custom
Mercator projection (changed the central meridian to 150 instead of 0). =
The
SRID number of our custom projection in the spatial_ref_sys table is =
999001
which is based on the record with an SRID of 54004. The proj4text for =
999001
looks like “+proj=3Dmerc +lat_ts=3D0 +lon_0=3D150 +k=3D1.000000 =
+x_0=3D0 +y_0=3D0
+ellps=3DWGS84 +datum=3DWGS84 units=3Dm”. When I load up the data, =
each record
has an SRID of 999001.</span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Is this all I need to do on the PostGIS side of =
things?</span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I’ve now added the layer to a bare mapfile but =
the
data is showing up like it would with a -1 srid. I have no projection
information of any sort defined in the mapfile so I assume I need to =
define a
PROJECTION section in the mapfile. Correct?</span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>How do I do this for a custom projection? I’ve =
found
examples on the list like the following which show how to enter the =
projection
section in a mapfile, but I can’t figure out what I should put in =
here.</span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>

<pre><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>PROJECTION</span></font></pre><pre><font
size=3D2 face=3D"Courier New"><span style=3D'font-size:10.0pt'>  =
"proj=3Dlcc"</span></font></pre><pre><font
size=3D2 face=3D"Courier New"><span style=3D'font-size:10.0pt'>  =
"ellps=3DGRS80"</span></font></pre><pre><font
size=3D2 face=3D"Courier New"><span style=3D'font-size:10.0pt'>  =
"lat_0=3D49"</span></font></pre><pre><font
size=3D2 face=3D"Courier New"><span style=3D'font-size:10.0pt'>  =
"lon_0=3D-95"</span></font></pre><pre><font
size=3D2 face=3D"Courier New"><span style=3D'font-size:10.0pt'>  =
"lat_1=3D49"</span></font></pre><pre><font
size=3D2 face=3D"Courier New"><span style=3D'font-size:10.0pt'>  =
"lat_2=3D77"</span></font></pre><pre><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>END</span></font></pre><pre><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font></pre>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Thanks,</span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Benjamin Wragg</span></font></p>

</div>

</body>

</html>

------=_NextPart_000_000F_01C334A1.F1E79190--




More information about the MapServer-users mailing list