I don't have any experience working with Geoserver, and I have no experience
developing inside the Geotools library. However, I wonder if it might not be
easier for you to extend the DirectPosition2D class with your own
implementation and then import that jar into Geoserver. Just a thought.
-Duane
From: lv [mailto:[email protected]]
Sent: Wednesday, November 10, 2010 4:08 AM
To: [email protected]
Cc: [email protected]
Subject: Re: [Geotools-gt2-users] How to offset GIS data
Hi,
My customer requires all points of maps should be offset to a new place. To
offset data, a JAR file which contains a algorithm is used.
x and y coordinate are passed to this JAR. New x and y coordinate will be
created by it.
For each point, the offset for x and y is different. But for a point, the
offset distance is the same.
For example, two points [point A (10, 20), point B (30, 40)] are passed to that
JAR. After processing in the 1st time, point A (11, 23), point B (36, 45).
In the 2nd time, point A (11, 23), point B (36, 45).
A people told me that I can create views in Postgis. Another people recommended
me to use SLD. They are good methods. But I cannot get the algorithm and I
don't know the offset distance for each point. Original GIS data may be stored
in PostGIS, Oracle, or just shape files. Therefore, I have to add this JAR to
Geoserver or Geotools projects and pass coordinate of each point to get new
coordinates.
In GeoTools project, I change DirectPosition2D.java as follow
public DirectPosition2D(final CoordinateReferenceSystem crs,
final double x, final double y)
{
//super(x, y);
super(x+100000000,y+200000000); //added by YE
setCoordinateReferenceSystem(crs);
}
(Above modification is just a test. I will add jar file later. )
Then, the map created from shape files are offset. I test this using
Quickstart.java. After testing, I rebuild Geotools using maven [mvn -DskipTests
clean install]. The build is successful.
After that, I copy all libraries of GeoTool
[D:\GeoTool_win2008_32\trunk\target\binaries] to Geoserver source code
[E:\myGeoserver\downloadSourceCode\src\web\app\target\geoserver\WEB-INF\lib].
Then, I rebuild Geoserver. However, the coordinate is not changed.
> Date: Wed, 10 Nov 2010 18:42:55 +1100
> Subject: Re: [Geotools-gt2-users] How to offset GIS data
> From: [email protected]
> To: [email protected]
> CC: [email protected]
>
> Hello,
>
> I'm not sure why you want to modify GeoServer or GeoTools source code
> to move some data points around ? This is something that you would do
> in your own code.
>
> However, I probably don't understand your question properly. It's not
> really clear what you mean by...
>
> "This JAR file can create random data. I should get these random data
> and offset the correct GIS data"
>
> Perhaps if you could provide a clearer explanation people here will be
> able to help you.
>
> Michael
>
>
> 2010/11/2 lv <[email protected]>:
> > Hi,
> >
> > I am new in GIS and GeoTool. My question is about how to change the
> > Geoserver's source code.
> > I should send this email to Geoserver's mailing list but nobody can tell me
> > how to modify Geoserver's source code at Geoserver's mailing-list. I have
> > waited for more than 2 weeks.
> > What I need is offsetting the GIS data after getting data from source
> > (database or others) and before publishing map. The reason why I cannot use
> > SLD is that my boss gave me a jar file and I should use this JAR file to
> > offset data. My boss does not want to use SLD. This JAR file can create
> > random data. I should get these random data and offset the correct GIS data.
> > In each layer, ever point should be moved to different place. For example,
> > 30% points should be moved to North 100 meters. 30% points should be moved
> > to south 20 meters. The rest points should be moved to east 300 meters.
> >
> > Should I change the Geoserver's source code or the jar file of GeoTool at
> > Geoserver?
> > Which part of code should I modify if I should change the jar files of
> > GeoTool?
> >
> > Thanks a lot.
> > ------------------------------------------------------------------------------
> > Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
> > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> > http://p.sf.net/sfu/nokia-dev2dev
> > _______________________________________________
> > Geotools-gt2-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> >
> >
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users