Hi


your aim is not to change GeoServer's source code. You are not allowed
to publish the real coordinates to the public. One approach is to
randomly falsify the coordinates of your points or . 

You wrote that you want to use a database like oracle or
postgresql/postgis. The first step is to import your shape into the
database, for postgis you can use e.g. shp2pgsql [1]. This will create
a table from your shape. Then you have to make a view in the database
[2]:



CREATE OR REPLACE VIEW your_table_v AS 

  SELECT ST_Translate(wkb_geometry, random()*30, random()*30) FROM your_table



ST_Translate [3] will offset the geometry using fixed values (in x and
y direction). But you can use the random() function: The return value
is a random number between 0.0. and 1.0. Using the return value as
offset values it will translate every single point different but only
between 0.0 and 1.0 meter/feet/degrees. If you want to apply bigger
offsets you can multiply the random number by a numerical value (e.g.
30). This will apply offsets between 0 and 30 for x and y direction.





[1]: http://postgis.refractions.net/docs/ch04.html#shp2pgsql_usage

[2]: http://www.postgresql.org/docs/8.4/static/sql-createview.html

[3]: http://postgis.refractions.net/documentation/manual-1.5/ST_Translate.html





regards

Stefan

mit freundlichem Gruss
Stefan Ziegler


----- Originalnachricht -----
Von: lv <[email protected]>
Gesendet: Don, 28.10.2010 10:46
An: [email protected]
Betreff: Re: [Geoserver-devel] How to change Geoserver's source code to offset 
GIS data


Hi, 

 

How to change Gerserver's source code?

Can st_translate offset each point to different place? For example, I have a 
shape which contains lots of points. Can st_translate offset each point to a 
different place or just offset all points to a same place? I have spent more 
than one week on looking for a solution. But I still cannot find it.
 

> Date: Wed, 27 Oct 2010 13:29:59 +0200
> From: [email protected]
> To: [email protected]; [email protected]
> Subject: AW: [Geoserver-devel] How to change GIS data before publishing map
> 
> Hi
> 
> my suggestion is: 
> 1) Import the data into postgis.
> 2) Create a view and adjust the offsets by using the ST_Translate [1] and 
> random() [2] functions, eg:
> 
> select st_translate(wkb_geometry, random()*30, random()*30) from your_table
> 
> This will translate the geometry with some pseudo randomized values (from 0 
> to 30).
> 
> 3) Publish the view in GeoServer.
> 
> 
> [1]: http://postgis.refractions.net/documentation/manual-1.5/ST_Translate.html
> [2]: http://www.postgresql.org/docs/8.2/interactive/functions-math.html
> 
> regards
> Stefan
> 
> 
> mit freundlichem Gruss
> Stefan Ziegler
> 
> 
> ----- Originalnac
hricht -----
> Von: lv <[email protected]>
> Gesendet: Mit, 27.10.2010 12:27
> An: [email protected]
> Betreff: [Geoserver-devel] How to change GIS data before publishing map
> 
> 
> I need to change the Geoserver source code to offset data before the map can 
> be published on the web browser.
> 
> My customer does not want to disclose precise GIS data and maps to the 
> developers who are not on client site. 
> 
> My customer gives me a jar file which can randomly create data for 
> offsetting. I can get these random data.
> 
> What should I do is as follow:
> 
> 1, I need to get data from database (Oracle or PostGIS).
> 
> 2, get data from the jar file to offset all GIS data in the map. For example, 
> 30% points of these data should be moved to south 100m. 30% points should be 
> moved to north 10m.
> 
> The rest of points should be moved to east 25m. 
> 
> 3, After gettin
g data from step 2, Geoserver can create new maps that all points are not at 
their original place.
> 
> 4, I use SLD (SLD with parameters) to offset maps but this solution is not 
> acceptable.
> 
> 
> 
> How to modify the source code of Geoserver 2.0.1?
> 
> 
> ------------------------------------------------------------------------------
> 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_______________________________________________
> Geoserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
                                          
------------------------------------------------------------------------------
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_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

------------------------------------------------------------------------------
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
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to