Thank you Andrea.

Thank you for your explanations about asking PostGIS directly and so on. 
It's a very good start for me!

 > By the numbers you get it seems your data is in some projected 
coordinate system. Which one, I cannot know.

Ah ok... Can it be Lambert93 (SRID = 310024140)?

Cheers too,
--
Lmhelp



On 05/07/2011 6:53 PM, Andrea Aime wrote:
> On Sat, May 7, 2011 at 6:31 PM, Lmhelp<[email protected]>  wrote:
>> Hi again,
>>
>> I just want here to put things a little bit clearer (I am a beginner, I
>> hope it won't be too confused).
>>
>> I have:
>> - a GeoServer layer L1 which data come from a PostGIS table T1
>> containing geometries of type "POINT" (points),
>> - a GeoServer layer L2 which data come from a PostGIS table T2
>> containing geometries of type "MULTIPOLYGON" (French departments),
>> - a GeoServer group of layers G containing these two layers L1 and L2.
>>
>> As a result, I want to display a map "containing" those two layers
>> (using OpenLayers).
>>
>> I need to compute a bounding box FROM these data ((T1 and T2) or (L1 and
>> L2) or (G)).
>> I need to do this programmatically.
>> The bounding box I'll get as a result has to fit exactly the displayed
>> data, in my case a map of France with "points" on it.
>>
>> The bounding boxes computed by Geoserver in my case are (for both T1 and
>> T2):
>> +--------+-----------+-----------+-----------+
>> | Min X  | Min Y     | Max X     | Max Y     |
>> +--------+-----------+-----------+-----------+
>> | 99,226 | 6,049,647 | 1,242,375 | 7,110,524 |
>> +--------+-----------+-----------+-----------+
>> =>  I don't understand what these huge numbers are (what is their unit of
>> measure, etc.)...
>
> These come from asking PostGIS directly. Depending on how you setup
> the store they might be the result of:
>
> select AsText(force_2d(Envelope(ST_Estimated_Extent('schema', 'table',
> 'column')))
>
> or
>
> select ST_AsText(ST_Force_2D(Envelope(ST_Extent(column)::geometry))))
> from schema:table
>
> where you have to replace schema, table and column for your specific case
> and be lenient since I've derived the queries from the code but did
> not have time to
> try them out (parenthesis might not be balanced and the like).
>
> The first query is run if you enabled "estimated extent" in the db, and uses 
> the
> spatial index statistics to compute the bbox quickly, the second is run if the
> first fails or if estimated extent is not enabled, and does a full
> scan of the table
> and computes an exact bounding box.
>
> By the numbers you get it seems your data is in some projected
> coordinate system.
> Which one, I cannot know.
>
> Cheers
> Andrea

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to