newbie on projection/datum

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

newbie on projection/datum

Gérald Estadieu-4
Hi all,

I know it is not the first time someone ask this kind of question but I still need some clarification from some experts here. I have a dataset from Macao to setup a demo on PostGIS/Geoserver + mapBuilder/uDig as a feasibility study. I got the all thing in shapefiles without any .prj file but I got a document with the following:
 
======================================================
Coordinates

Projection of Special Administrative Region of Macau

Transverse Mercator Projection.

Ellipsoid:

·    International Hayford (a = 6,378, 388.000 m, 1/f = 297.00000000000)
·    WGS-84 (World Geodetic System 1984) (a = 6,378,137.000 m, 1/f = 298.25722357000)


Origin

The following "datum" has been taken as the origin of the network for Special Administrative Region of Macau:

Longitude: 113º 32' 11'' E
Latitude: 22º 12' 44'' N

and the following as the corresponding rectangular coordinates:

20 000.000 m N and 20 000.000 m E


Projection parameters

International Hayford

Reference Ellipsoid    :    a (Major semi-axis) = 6,378,388.000 m
f (Flattening) = 1/297
Projection        :    Transverse Mercator Projection
Latitude of Origin    :    22º 12' 44'' N
Longitude of Origin    :    113º 32' 11'' E
False Easting        :    20,000.000 m (meters) [X=x+20,000.000 m]
False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]
Datum Level        :    Mean Sea Level
Scale Factor        :    1
====================================================

I imported all feature type in PostGIS but my SRID is -1 so far (which is normal since I did not specify anything). I can access my data in uDig/qGIS no problem when I use directly PostGIS but not when I use GeoServer with mapbuilder (probably due to the missing CRS). In Geoserver I declared my feature type in EPSG:4326 and everything has been accepted and validated by GeoServer.
Here are a few questions I have to understand how to make the all things properly in PostGIS and GeoServer
- Should I insert the CRS in PostGIS/Geoserver as defined above or it is better to make a kind of "translation" in my data through some SQL code to make it fit in the 4326 system?
- based on the above CRS definition how can I write it in the EPSG format? I am not sure I understand how it is written. I believe I have everything to do it but how? Good question!!! Again isn't it easier to "translate" my data (since I can see that I have a North and East translation). (something like GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Lon", EAST], AXIS["Lat", NORTH], AUTHORITY["EPSG","4326"]])

I would appreciate some lights on my missing knowledge on this area!

Gerald

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie on projection/datum

Brent Owens
You should always tell geoserver what projection your data is in, even
if it is the regular 4326 lat/lon projection. The data in the database
should also be in the same projection and you should specify that in
postgis.
When a request comes in from mapbuilder or udig, a "requested" SRS value
is sent. Geoserver will look at that value, then look at the SRS of the
data. If they are different, it will reproject the data for you into the
"requested" projection.

Brent Owens
(The Open Planning Project)



Gerald Estadieu wrote:

> Hi all,
>
> I know it is not the first time someone ask this kind of question but
> I still need some clarification from some experts here. I have a
> dataset from Macao to setup a demo on PostGIS/Geoserver +
> mapBuilder/uDig as a feasibility study. I got the all thing in
> shapefiles without any .prj file but I got a document with the following:
>  
> ======================================================
> Coordinates
>
> Projection of Special Administrative Region of Macau
>
> Transverse Mercator Projection.
>
> Ellipsoid:
>
> ·    International Hayford (a = 6,378, 388.000 m, 1/f = 297.00000000000)
> ·    WGS-84 (World Geodetic System 1984) (a = 6,378,137.000 m, 1/f =
> 298.25722357000)
>
>
> Origin
>
> The following "datum" has been taken as the origin of the network for
> Special Administrative Region of Macau:
>
> Longitude: 113º 32' 11'' E
> Latitude: 22º 12' 44'' N
>
> and the following as the corresponding rectangular coordinates:
>
> 20 000.000 m N and 20 000.000 m E
>
>
> Projection parameters
>
> International Hayford
>
> Reference Ellipsoid    :    a (Major semi-axis) = 6,378,388.000 m
> f (Flattening) = 1/297
> Projection        :    Transverse Mercator Projection
> Latitude of Origin    :    22º 12' 44'' N
> Longitude of Origin    :    113º 32' 11'' E
> False Easting        :    20,000.000 m (meters) [X=x+20,000.000 m]
> False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]
> Datum Level        :    Mean Sea Level
> Scale Factor        :    1
> ====================================================
>
> I imported all feature type in PostGIS but my SRID is -1 so far (which
> is normal since I did not specify anything). I can access my data in
> uDig/qGIS no problem when I use directly PostGIS but not when I use
> GeoServer with mapbuilder (probably due to the missing CRS). In
> Geoserver I declared my feature type in EPSG:4326 and everything has
> been accepted and validated by GeoServer.
> Here are a few questions I have to understand how to make the all
> things properly in PostGIS and GeoServer
> - Should I insert the CRS in PostGIS/Geoserver as defined above or it
> is better to make a kind of "translation" in my data through some SQL
> code to make it fit in the 4326 system?
> - based on the above CRS definition how can I write it in the EPSG
> format? I am not sure I understand how it is written. I believe I have
> everything to do it but how? Good question!!! Again isn't it easier to
> "translate" my data (since I can see that I have a North and East
> translation). (something like GEOGCS["WGS 84", DATUM["WGS_1984",
> SPHEROID["WGS 84", 6378137.0, 298.257223563,
> AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]],
> PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree",
> 0.017453292519943295], AXIS["Lon", EAST], AXIS["Lat", NORTH],
> AUTHORITY["EPSG","4326"]])
>
> I would appreciate some lights on my missing knowledge on this area!
>
> Gerald
> ------------------------------------------------------------------------
>
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ------------------------------------------------------------------------
>
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>  

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie on projection/datum

Gérald Estadieu-4
Brent,

thanks for your answer.
I understand that I have to specify the projection both in Geoserver and Postgis, and that's where I am stuck because I actually do not know how to do it. In postgis I did not input SRID because I simply do not know what to do (just insert 4326 or translate all my features to correct the 20.000m translation described in my previous email and use 4326).
In geoserver you are forced to declare a CRS so I wrote 4326 but I am not sure neither how to declare my translation (if it is necessary at all).

Gerald



On 7/4/06, Brent Owens <[hidden email]> wrote:
You should always tell geoserver what projection your data is in, even
if it is the regular 4326 lat/lon projection. The data in the database
should also be in the same projection and you should specify that in
postgis.
When a request comes in from mapbuilder or udig, a "requested" SRS value
is sent. Geoserver will look at that value, then look at the SRS of the
data. If they are different, it will reproject the data for you into the
"requested" projection.



Brent Owens
(The Open Planning Project)



Gerald Estadieu wrote:

> Hi all,
>
> I know it is not the first time someone ask this kind of question but
> I still need some clarification from some experts here. I have a
> dataset from Macao to setup a demo on PostGIS/Geoserver +
> mapBuilder/uDig as a feasibility study. I got the all thing in
> shapefiles without any .prj file but I got a document with the following:
>
> ======================================================
> Coordinates
>
> Projection of Special Administrative Region of Macau
>
> Transverse Mercator Projection.
>
> Ellipsoid:

>
> ·    International Hayford (a = 6,378, 388.000 m, 1/f = 297.00000000000)
> ·    WGS-84 (World Geodetic System 1984) (a = 6,378,137.000 m, 1/f =
> 298.25722357000)
>
>
> Origin
>
> The following "datum" has been taken as the origin of the network for
> Special Administrative Region of Macau:
>
> Longitude: 113º 32' 11'' E
> Latitude: 22º 12' 44'' N
>
> and the following as the corresponding rectangular coordinates:
>
> 20 000.000 m N and 20 000.000 m E
>
>
> Projection parameters
>
> International Hayford
>
> Reference Ellipsoid    :    a (Major semi-axis) = 6,378,388.000 m

> f (Flattening) = 1/297
> Projection        :    Transverse Mercator Projection
> Latitude of Origin    :    22º 12' 44'' N
> Longitude of Origin    :    113º 32' 11'' E
> False Easting        :    20,000.000 m (meters) [X=x+20,000.000 m]
> False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]
> Datum Level        :    Mean Sea Level
> Scale Factor        :    1
> ====================================================
>
> I imported all feature type in PostGIS but my SRID is -1 so far (which
> is normal since I did not specify anything). I can access my data in
> uDig/qGIS no problem when I use directly PostGIS but not when I use
> GeoServer with mapbuilder (probably due to the missing CRS). In
> Geoserver I declared my feature type in EPSG:4326 and everything has
> been accepted and validated by GeoServer.
> Here are a few questions I have to understand how to make the all
> things properly in PostGIS and GeoServer
> - Should I insert the CRS in PostGIS/Geoserver as defined above or it
> is better to make a kind of "translation" in my data through some SQL
> code to make it fit in the 4326 system?
> - based on the above CRS definition how can I write it in the EPSG
> format? I am not sure I understand how it is written. I believe I have
> everything to do it but how? Good question!!! Again isn't it easier to
> "translate" my data (since I can see that I have a North and East
> translation). (something like GEOGCS["WGS 84", DATUM["WGS_1984",
> SPHEROID["WGS 84", 6378137.0, 298.257223563,
> AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]],
> PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree",
> 0.017453292519943295], AXIS["Lon", EAST], AXIS["Lat", NORTH],
> AUTHORITY["EPSG","4326"]])
>
> I would appreciate some lights on my missing knowledge on this area!
>
> Gerald
> ------------------------------------------------------------------------
>
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> <a href="http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=120709&amp;bid=263057&amp;dat=121642" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ------------------------------------------------------------------------
>
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> <a href="https://lists.sourceforge.net/lists/listinfo/geoserver-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.sourceforge.net/lists/listinfo/geoserver-users
>


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie on projection/datum

alexander-petkov
In reply to this post by Gérald Estadieu-4
> - Should I insert the CRS in PostGIS/Geoserver as defined above or it is
> better to make a kind of "translation" in my data through some SQL code to
> make it fit in the 4326 system?

Well, you can do either, but it is definitely possible to define your
projection in both PostGIS and Geoserver. Which branch of Geoserver
are you running (WCS or trunk)?

> - based on the above CRS definition how can I write it in the EPSG format?
Just see the wiki page(s):

http://docs.codehaus.org/display/GEOSDOC/Defining+a+custom+projection

And don't hesitate to ask more questions if something is not clear.

Alex

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie on projection/datum

Randy George
In reply to this post by Gérald Estadieu-4

Hi Gerald,

        One further caveat, if you are planning to use the WFS service as
well as the WMS you will probably want to just convert your geometry to SRS
4326. The re-projection capability of WFS is evidently defined at OGC
(WFS1.1) and plans to implement in GeoServer appear to be down the road
slightly with 1.4.?

I. If you want GeoServer WMS to recognize your CRS you will need to add
some information to GeoServer since I don't think this is a common EPSG.

You would need to modify the gt2-epsg.jar adding a new custom CRS definition
to the end of the \org\geotools\referencing\crs\epsg.properties file.

For example substituting your Macau Special Administration parameters and
making use of the existing EPSG Datum 104106:
 
104309=PROJCS["Macau Special Admin",
GEOGCS["GCS_Datum_Lisboa_Hayford",DATUM["D_Datum_Lisboa_Hayford",SPHEROID["I
nternational_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["Degree",0.01745
3292519943295],AUTHORITY["ESRI","104106"]]
,PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",22.212222]
,PARAMETER["central_meridian",113.536389],PARAMETER["scale_factor",1.0],PARA
METER["false_easting",20000],PARAMETER["false_northing",20000],UNIT["metre",
1,AUTHORITY["EPSG","9001"]],AUTHORITY["Macau Special Admin","104309"]]

(Note that I didn't check this against real data)


II. If you want both WMS and WFS to serve your data source you should
transform your datastore geometry to 4326 (or wait for 1.4.? release).

        If you have a coord transform package with your CRS you could just
change from the Macau CRS to 4326. Another way to do this if you have
PostGIS is to add a new record to the spatial_ref_sys of your database.
        Looking at the Macau Special Administration parameters you listed, I
think you could take 'ESRI 102160' from the modified spatial_ref_sys table
of PostGIS and modify it with your origin and false easting,northing.

   Latitude of Origin    :    22º 12' 44'' N = 22.212222
   Longitude of Origin    :    113º 32' 11'' E = 113.536389
   False Easting        :    20,000.000 m (meters) [X=x+20,000.000 m]
   False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]

For example changing from 102160 ESRI in the PostGIS spatial_ref_sys table
you would have something like this:

INSERT INTO spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text)
VALUES (104309, 'Macau Special Admin', 104309,
'PROJCS["Datum_73_Hayford_Gauss_IGeoE",GEOGCS["GCS_Datum_73",DATUM["D_Datum_
73",SPHEROID["International_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["
Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["
False_Easting",20000.0],PARAMETER["False_Northing",20000.0],PARAMETER["Centr
al_Meridian",113.536389],PARAMETER["Scale_Factor",1],PARAMETER["Latitude_Of_
Origin",39.66666666666666],UNIT["Meter",1]]', '+proj=tmerc +lat_0=22.212222
+lon_0=113.536389 +k=1.000000 +x_0=20000.0 +y_0=20000.0 +ellps=intl
+units=m');

Once you have your CRS defined in the spatial_ref_sys you should be able to
get the transformed coordinates like this:

SELECT asewkt(transform(the_geom),4326) from your_table;

I hope this helps more than hinders, but when you have a non standard
coordinate system it does take some playing around to get things to work. I
know this from recent experience and Chris Holmes helpfully pointed out that
the WFS re-projection is a future feature.

Thanks
Randy George
www.cadmaps.com






-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Brent
Owens
Sent: Tuesday, July 04, 2006 9:23 AM
To: Gerald Estadieu
Cc: [hidden email]
Subject: Re: [Geoserver-users] newbie on projection/datum

You should always tell geoserver what projection your data is in, even
if it is the regular 4326 lat/lon projection. The data in the database
should also be in the same projection and you should specify that in
postgis.
When a request comes in from mapbuilder or udig, a "requested" SRS value
is sent. Geoserver will look at that value, then look at the SRS of the
data. If they are different, it will reproject the data for you into the
"requested" projection.

Brent Owens
(The Open Planning Project)



Gerald Estadieu wrote:

> Hi all,
>
> I know it is not the first time someone ask this kind of question but
> I still need some clarification from some experts here. I have a
> dataset from Macao to setup a demo on PostGIS/Geoserver +
> mapBuilder/uDig as a feasibility study. I got the all thing in
> shapefiles without any .prj file but I got a document with the following:
>  
> ======================================================
> Coordinates
>
> Projection of Special Administrative Region of Macau
>
> Transverse Mercator Projection.
>
> Ellipsoid:
>
> ·    International Hayford (a = 6,378, 388.000 m, 1/f = 297.00000000000)
> ·    WGS-84 (World Geodetic System 1984) (a = 6,378,137.000 m, 1/f =
> 298.25722357000)
>
>
> Origin
>
> The following "datum" has been taken as the origin of the network for
> Special Administrative Region of Macau:
>
> Longitude: 113º 32' 11'' E
> Latitude: 22º 12' 44'' N
>
> and the following as the corresponding rectangular coordinates:
>
> 20 000.000 m N and 20 000.000 m E
>
>
> Projection parameters
>
> International Hayford
>
> Reference Ellipsoid    :    a (Major semi-axis) = 6,378,388.000 m
> f (Flattening) = 1/297
> Projection        :    Transverse Mercator Projection
> Latitude of Origin    :    22º 12' 44'' N
> Longitude of Origin    :    113º 32' 11'' E
> False Easting        :    20,000.000 m (meters) [X=x+20,000.000 m]
> False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]
> Datum Level        :    Mean Sea Level
> Scale Factor        :    1
> ====================================================
>
> I imported all feature type in PostGIS but my SRID is -1 so far (which
> is normal since I did not specify anything). I can access my data in
> uDig/qGIS no problem when I use directly PostGIS but not when I use
> GeoServer with mapbuilder (probably due to the missing CRS). In
> Geoserver I declared my feature type in EPSG:4326 and everything has
> been accepted and validated by GeoServer.
> Here are a few questions I have to understand how to make the all
> things properly in PostGIS and GeoServer
> - Should I insert the CRS in PostGIS/Geoserver as defined above or it
> is better to make a kind of "translation" in my data through some SQL
> code to make it fit in the 4326 system?
> - based on the above CRS definition how can I write it in the EPSG
> format? I am not sure I understand how it is written. I believe I have
> everything to do it but how? Good question!!! Again isn't it easier to
> "translate" my data (since I can see that I have a North and East
> translation). (something like GEOGCS["WGS 84", DATUM["WGS_1984",
> SPHEROID["WGS 84", 6378137.0, 298.257223563,
> AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]],
> PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree",
> 0.017453292519943295], AXIS["Lon", EAST], AXIS["Lat", NORTH],
> AUTHORITY["EPSG","4326"]])
>
> I would appreciate some lights on my missing knowledge on this area!
>
> Gerald
> ------------------------------------------------------------------------
>
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ------------------------------------------------------------------------
>
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>  

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie on projection/datum

Gérald Estadieu-4
Hi Randy,

thanks for this very details information, that's what I needed to understand.
Here is what I have done so far:
- insert my SRS into Geoserver gt2-epsg.jar and it appears on the list in the web admin. When I connect to postgis and input it, it shows me long/lat around 113 and 22 which are corresponding to the positionning of Macao.
- insert the SRS into my database in spatial_ref_sys (btw I could not find in the list the one you mention 104106 from ESRI, is it normal?).
Until now, my geom column was in SRID=-1, so I change it to the new one 104309 (sometimes does not work due to some 'violation' by some row, I have to investigate on this probably).
I tried to create a similar table with srid 4326 and do an:

insert into basemap_land select gid,entity,layer,"level",elevation,color,Transform(the_geom,4326) from land_2005;

It does input my 3 polygons inside the new table with lat around 22 and long 0.xxx. Is it normal for the long?
Moreover when I try to make it as a feature type in geoserver, it cannot detect the srs and if I put 4326 it keeps telling me

'The FeatureType 'basemap_land' has a NULL extent.
HINT: the dataset is empty or has no default geometry attribute.'

The dataset is not empty and there is one geometry column. Is it because the CRS is not correct and so the transform is not working well?

here is the SQL I use to create my new table (based on the existing one):
CREATE TABLE basemap_land
(
  gid serial NOT NULL,
  entity varchar(14),
  layer varchar(32),
  "level" int8,
  elevation float8,
  color int4,
  the_geom geometry,
  CONSTRAINT basemap_land_pkey PRIMARY KEY (gid),
  CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2),
  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL),
  CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 4326)
)
WITH OIDS;
ALTER TABLE basemap_land OWNER TO postgres;


For information I use geoserver 1.3.2 (btw, I read there is a sld wizard but no where there is a link to access it...unless I am nuts).

I can see I am getting close to the stage where it can works...hope someone can help me again to understand this area where I am really a newbie, still.
Thanks

Gerald



On 7/6/06, Randy George <[hidden email]> wrote:

Hi Gerald,

        One further caveat, if you are planning to use the WFS service as
well as the WMS you will probably want to just convert your geometry to SRS
4326. The re-projection capability of WFS is evidently defined at OGC
(WFS1.1) and plans to implement in GeoServer appear to be down the road
slightly with 1.4.?

I.      If you want GeoServer WMS to recognize your CRS you will need to add
some information to GeoServer since I don't think this is a common EPSG.

You would need to modify the gt2-epsg.jar adding a new custom CRS definition
to the end of the \org\geotools\referencing\crs\epsg.properties file.

For example substituting your Macau Special Administration parameters and
making use of the existing EPSG Datum 104106:

104309=PROJCS["Macau Special Admin",
GEOGCS["GCS_Datum_Lisboa_Hayford",DATUM["D_Datum_Lisboa_Hayford",SPHEROID["I
nternational_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["Degree", 0.01745
3292519943295],AUTHORITY["ESRI","104106"]]
,PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",22.212222]
,PARAMETER["central_meridian",113.536389 ],PARAMETER["scale_factor",1.0],PARA
METER["false_easting",20000],PARAMETER["false_northing",20000],UNIT["metre",
1,AUTHORITY["EPSG","9001"]],AUTHORITY["Macau Special Admin","104309"]]

(Note that I didn't check this against real data)


II. If you want both WMS and WFS to serve your data source you should
transform your datastore geometry to 4326 (or wait for 1.4.? release).

        If you have a coord transform package with your CRS you could just
change from the Macau CRS to 4326. Another way to do this if you have
PostGIS is to add a new record to the spatial_ref_sys of your database.
        Looking at the Macau Special Administration parameters you listed, I
think you could take 'ESRI 102160' from the modified spatial_ref_sys table
of PostGIS and modify it with your origin and false easting,northing.

   Latitude of Origin    :    22º 12' 44'' N = 22.212222
   Longitude of Origin    :    113º 32' 11'' E = 113.536389
   False Easting        :    20,000.000 m (meters) [X=x+20,000.000 m]
   False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]

For example changing from 102160 ESRI in the PostGIS spatial_ref_sys table
you would have something like this:

INSERT INTO spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text)
VALUES (104309, 'Macau Special Admin', 104309,
'PROJCS["Datum_73_Hayford_Gauss_IGeoE",GEOGCS["GCS_Datum_73",DATUM["D_Datum_
73",SPHEROID["International_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["
Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["
False_Easting", 20000.0],PARAMETER["False_Northing",20000.0],PARAMETER["Centr
al_Meridian",113.536389],PARAMETER["Scale_Factor",1],PARAMETER["Latitude_Of_
Origin",39.66666666666666],UNIT["Meter",1]]', '+proj=tmerc +lat_0= 22.212222
+lon_0=113.536389 +k=1.000000 +x_0=20000.0 +y_0=20000.0 +ellps=intl
+units=m');

Once you have your CRS defined in the spatial_ref_sys you should be able to
get the transformed coordinates like this:

SELECT asewkt(transform(the_geom),4326) from your_table;

I hope this helps more than hinders, but when you have a non standard
coordinate system it does take some playing around to get things to work. I
know this from recent experience and Chris Holmes helpfully pointed out that
the WFS re-projection is a future feature.

Thanks
Randy George
www.cadmaps.com






-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Brent
Owens
Sent: Tuesday, July 04, 2006 9:23 AM
To: Gerald Estadieu
Cc: [hidden email]
Subject: Re: [Geoserver-users] newbie on projection/datum

You should always tell geoserver what projection your data is in, even
if it is the regular 4326 lat/lon projection. The data in the database
should also be in the same projection and you should specify that in
postgis.
When a request comes in from mapbuilder or udig, a "requested" SRS value
is sent. Geoserver will look at that value, then look at the SRS of the
data. If they are different, it will reproject the data for you into the
"requested" projection.

Brent Owens
(The Open Planning Project)



Gerald Estadieu wrote:
> Hi all,
>

> I know it is not the first time someone ask this kind of question but
> I still need some clarification from some experts here. I have a
> dataset from Macao to setup a demo on PostGIS/Geoserver +
> mapBuilder/uDig as a feasibility study. I got the all thing in
> shapefiles without any .prj file but I got a document with the following:
>
> ======================================================
> Coordinates
>
> Projection of Special Administrative Region of Macau
>
> Transverse Mercator Projection.
>
> Ellipsoid:
>
> ·    International Hayford (a = 6,378, 388.000 m, 1/f = 297.00000000000)
> ·    WGS-84 (World Geodetic System 1984) (a = 6,378,137.000 m, 1/f =
> 298.25722357000)
>
>
> Origin
>
> The following "datum" has been taken as the origin of the network for
> Special Administrative Region of Macau:
>
> Longitude: 113º 32' 11'' E
> Latitude: 22º 12' 44'' N
>
> and the following as the corresponding rectangular coordinates:
>
> 20 000.000 m N and 20 000.000 m E
>
>
> Projection parameters
>
> International Hayford
>
> Reference Ellipsoid    :    a (Major semi-axis) = 6,378,388.000 m
> f (Flattening) = 1/297
> Projection        :    Transverse Mercator Projection
> Latitude of Origin    :    22º 12' 44'' N
> Longitude of Origin    :    113º 32' 11'' E
> False Easting        :    20,000.000 m (meters) [X=x+20, 000.000 m]
> False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]
> Datum Level        :    Mean Sea Level
> Scale Factor        :    1
> ====================================================
>
> I imported all feature type in PostGIS but my SRID is -1 so far (which
> is normal since I did not specify anything). I can access my data in
> uDig/qGIS no problem when I use directly PostGIS but not when I use
> GeoServer with mapbuilder (probably due to the missing CRS). In
> Geoserver I declared my feature type in EPSG:4326 and everything has
> been accepted and validated by GeoServer.
> Here are a few questions I have to understand how to make the all
> things properly in PostGIS and GeoServer
> - Should I insert the CRS in PostGIS/Geoserver as defined above or it
> is better to make a kind of "translation" in my data through some SQL
> code to make it fit in the 4326 system?
> - based on the above CRS definition how can I write it in the EPSG
> format? I am not sure I understand how it is written. I believe I have
> everything to do it but how? Good question!!! Again isn't it easier to
> "translate" my data (since I can see that I have a North and East
> translation). (something like GEOGCS["WGS 84", DATUM["WGS_1984",
> SPHEROID["WGS 84", 6378137.0 , 298.257223563,
> AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]],
> PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree",
> 0.017453292519943295], AXIS["Lon", EAST], AXIS["Lat", NORTH],
> AUTHORITY["EPSG","4326"]])
>
> I would appreciate some lights on my missing knowledge on this area!
>
> Gerald
> ------------------------------------------------------------------------
>
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ------------------------------------------------------------------------
>
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users