Andrea,
what about performing a count then add something like this?
If count ==0 then
Bbox = 0 0 0 0
Carlo

Il 21/gen/2014 17:37 "Andrea Aime" <[email protected]> ha
scritto:
>
> On Tue, Jan 21, 2014 at 5:08 PM, Damiano Albani <[email protected]>
wrote:
>>
>> Hello,
>>
>> When uploading an "empty" Shapefile (i.e. with no features), it looks
like GeoServer configures the datastore with bounds being equal to what is
explicitly specified in the Shapefile.
>> And clicking on "compute from data" in the configuration page doesn't
make the value change.
>> So what bounds should be advertised for layers of this kind? All zeros?
That's what OGR does apparently:
>>
>> $ ogrinfo -al empty.shp
>>   Layer name: empty
>>   Geometry: Line String
>>   Feature Count: 0
>>   Extent: (19496742305194890055511892394450289164288.000000,
19496742305194890055511892394450289164288.000000) -
(-19496742305194890055511892394450289164288.000000,
-19496742305194890055511892394450289164288.000000)
>>   Layer SRS WKT:
>>   GEOGCS["GCS_WGS_84",
>>       DATUM["WGS_84",
>>           SPHEROID["WGS84",6378137,000,298,257223563]],
>>       PRIMEM["Greenwich",0.0],
>>       UNIT["Degree",0.0174532925199433]]
>>   ID: String (10.0)
>>   ...
>>
>> $ ogrinfo -sql 'RECOMPUTE EXTENT ON empty' empty.shp
>>
>> $ ogrinfo -al empty.shp
>>   Layer name: empty
>>   Geometry: Line String
>>   Feature Count: 0
>>   Extent: (0.000000, 0.000000) - (0.000000, 0.000000)
>>   Layer SRS WKT:
>>   GEOGCS["GCS_WGS_84",
>>       DATUM["WGS_84",
>>           SPHEROID["WGS84",6378137,000,298,257223563]],
>>       PRIMEM["Greenwich",0.0],
>>       UNIT["Degree",0.0174532925199433]]
>>   ID: String (10.0)
>>   ...
>>
>> I know it doesn't make much sense to work with empty Shapefiles but I
have to handle this case, having a user-exposed GeoServer.
>> More precisely, I have an application which queries GeoServer for layers
information and then feeds it to OpenLayers for WMS rendering.
>> And I can confirm that OpenLayers really chokes on extent values like
the weird one shown above :-)
>
>
> GeoServer does not have a way to dodge the values contained in the
headers and do a manual scan.
> It would be possible to implement it though, but it would have to be
optional, scanning thorough large
> data sources can take ages (as in hours, and during that time, the admin
interface is locked)
>
> Cheers
> Andrea
>
> --
> == Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
> mob: +39  339 8844549
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> -------------------------------------------------------
>
>
------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
>
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to