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: geoserver-users-bounces@lists.sourceforge.net
[mailto:geoserver-users-bounces@lists.sourceforge.net] On Behalf Of Brent
Owens
Sent: Tuesday, July 04, 2006 9:23 AM
To: Gerald Estadieu
Cc: geoserver-users@lists.sourceforge.net
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:======================================================
CoordinatesProjection 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'' Nand 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 : 1I 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
Geoserver-users@lists.sourceforge.net
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
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users