How to know at what level of resolution RL2_GetMapImage may crash

15 views
Skip to first unread message

jose.che...@gmail.com

unread,
Apr 29, 2015, 7:26:03 AM4/29/15
to spatiali...@googlegroups.com
Hi, 

I am using the following expression:

select 'kk', RL2_GetMapImage ( 'lidar-dem' , GeomFromEWKT('SRID=3042;POLYGON((716193.3909999998 4264206.1356,687122.046 4263475.3113,686689.8147999998 4281972.077999999,715693.9118999997 4282703.875099999,716193.3909999998 4264206.1356))') , 256 , 256 , 'shaded_relief_factor_60' , 'image/jpeg',  '#ffffff', 0 , 100 , 1);

Everything works fine, but as in the following post when you try to export a big portion of your map:


The functions returns NULL,

For me, I am trying to use 5901 pixels as width and 3846 pixels and height.

By the way, my raster coverage is a big DEM, using a shaded-relief sld style, I am interested in exporting the whole composition at the raw resolution.

What would be the way to know, for a given raster coverage, which is the maximum number of pixels that you can retrieve from GetMapImage without crashing, it is try and error the only way?

Why do I want to do this?, because I am in loved with the result of applying the shaded relief effect to my DEM when you use WMSlite, and I would need that in a file as RGB.

And if you suggest about hsv_merge.py, Mapnik and many others, you don't get the same effect. I haven't had luch with those ones.

Thanks,

a.fu...@lqt.it

unread,
Apr 29, 2015, 11:42:37 AM4/29/15
to spatiali...@googlegroups.com
On Wed, 29 Apr 2015 04:26:03 -0700 (PDT), jose.che...@gmail.com
wrote:
> What would be the way to know, for a given raster coverage, which is
> the maximum number of pixels that you can retrieve from GetMapImage
> without crashing, it is try and error the only way?
>
> The functions returns NULL
>

Hi Jose,

rasterlite2 is never expected to crash, it's always expected to
gracefully fail.
sometimes it could refuse to service any potentially harmful
request; and in this case a NULL will be usually returned.

if you do actually experience some crash this is surely due
to some unresolved bug and certainly isn't intentional.
anyway a function call returning NULL is not at all a crash;
it's more probably the effect of some safety precaution adopted
in order to avoid a possible crash.

GetMapImaage() requires a big bunch of free RAM in order to create
very big images, and the actual amount of RAM your process can
be effectively able to allocate strongly varies depending on the
operating system, the hardware configuration and many other
factors (e.g. actual workload, memory fragmentation and alike).

so GetMapImage() will refuse to start servicing any request
exceeding what prudence and good common sense consider to be
a "reasonable size".
this limit varies from version to version, anyway you can
safely assume that any request in excess of 4096x4095 pixels
could be probably rejected.

anyway this is not a big limitation: you simply have to export
a mosaic of precisely framed images, each one of them presenting
a reasonably contained size.

bye Sandro

José Sánchez

unread,
Apr 29, 2015, 4:20:07 PM4/29/15
to spatiali...@googlegroups.com
Thanks, Sandro.





--
You received this message because you are subscribed to a topic in the Google Groups "SpatiaLite Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/spatialite-users/CX9B4GIsQl4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to spatialite-use...@googlegroups.com.
To post to this group, send email to spatiali...@googlegroups.com.
Visit this group at http://groups.google.com/group/spatialite-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages