Re: [MapServer-users] filtering the data based on postgis attributes

2023-11-28 Thread Seth G via MapServer-users
Hi Marcin,

In these cases previously I've used a SQL trick to implement this, by setting a 
default value for the parameter (of a non-existent ID) and adding an OR clause 
to the SQL. E.g;

VALIDATION
"default_pid" "-1"
..

WHERE (pid  = %pid% OR %pid% = -1)

If no value is provided then the SQL will be WHERE (pid  = -1 OR -1 = -1) which 
will always return True so all records will return.

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Tue, Nov 28, 2023, at 3:32 PM, Marcin Niemyjski via MapServer-users wrote:
> Hello, 
> I would like to define several dimensions for filtering my WMS (Web Map 
> Service). They are based on a PostGIS table from which the service is 
> exposed. Here lies my problem because among the required information to 
> expose, I need to provide the following to the map server:
> 
>  • wms_dimensionlist: (Mandatory)
>  • wms_[dimensionname]_item: (Mandatory)
>  • wms_[dimensionname]_units: (Mandatory)
>  • wms_[dimensionname]_extent: (Mandatory)
>  • wms_[dimensionname]_default: (Optional)
> My issue arises because I want to filter my data based on the "product_id" 
> column containing a string. The table is large, so it's not possible to 
> provide all the ID values to "wms_productid_extent."
> 
> So, I thought about using 
> https://mapserver.org/cgi/runsub.html#table-of-contents, but the problem 
> arises with the implementation in the query. I would like to lead to a 
> situation where if I don't provide any filtering parameters (product_id, 
> cloud_cover), the entire data set is returned.
> 
> I do not want to use this:
> DATA 'geometry from (select * from mrc order by maxcc desc) where pid = 
> '%pid%' as subquerry using unique unique_id using srid=3857'
> because if I do not provide pid, my query wiill not work.
> 
> 
> 
> So, to summarize I'm looking for something like this:
> 
> DATA 'geometry from (select * from mrc order by maxcc desc) as subquerry 
> using unique unique_id using srid=3857'
> 
> VALIDATION
> 'maxCC' '^[0-9](1, 3)$'
> 'tile' '^.{6}$'
> 'pid' '^.{65}$'
> END
> 
> No default values (except time), if none is provided Mapserver does not 
> filter the data (except time).
> 
> Best,
> Marcin
> 
 

> 
> Book time to meet with me 
> 
> 
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[MapServer-users] filtering the data based on postgis attributes

2023-11-28 Thread Marcin Niemyjski via MapServer-users
Hello,
I would like to define several dimensions for filtering my WMS (Web Map 
Service). They are based on a PostGIS table from which the service is exposed. 
Here lies my problem because among the required information to expose, I need 
to provide the following to the map server:

  *   wms_dimensionlist: (Mandatory)
  *   wms_[dimensionname]_item: (Mandatory)
  *   wms_[dimensionname]_units: (Mandatory)
  *   wms_[dimensionname]_extent: (Mandatory)
  *   wms_[dimensionname]_default: (Optional)

My issue arises because I want to filter my data based on the "product_id" 
column containing a string. The table is large, so it's not possible to provide 
all the ID values to "wms_productid_extent."

So, I thought about using 
https://mapserver.org/cgi/runsub.html#table-of-contents, but the problem arises 
with the implementation in the query. I would like to lead to a situation where 
if I don't provide any filtering parameters (product_id, cloud_cover), the 
entire data set is returned.

I do not want to use this:
DATA 'geometry from (select * from mrc order by maxcc desc) where pid = '%pid%' 
as subquerry using unique unique_id using srid=3857'
because if I do not provide pid, my query wiill not work.


So, to summarize I'm looking for something like this:


DATA 'geometry from (select * from mrc order by maxcc desc) as subquerry using 
unique unique_id using srid=3857'

VALIDATION
'maxCC' '^[0-9](1, 3)$'
'tile' '^.{6}$'
'pid' '^.{65}$'
END

No default values (except time), if none is provided Mapserver does not filter 
the data (except time).

Best,
Marcin
[https://res.cdn.office.net/assets/bookwithme/misc/CalendarPerson20px.png]
   Book time to meet with 
me
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] I want to change Map

2023-11-28 Thread Sven Schroeter via MapServer-users

Hi,

Tile-based maps are provided in a predefined tileset. In the case of 
Google or OSM, for example, this is usually in EPSG 3857 and is defined 
in a grid with corresponding resolutions for the different zoom levels 
(always based on an extent): 
https://mapserver.org/mapcache/config.html#preconfigured-grids

A WMS is usually used as the data source.
Of course, you can also do this for self-defined tilesets with other 
resolutions and extents, as in the case of the Korean institute.
With MS4W and the Mapcache software it contains, you can define and 
create such a tileset yourself.


Greetings from Germany
Sven



Am 28.11.2023 um 02:00 schrieb 최종호 via MapServer-users:

Hello everyone.!
Good morning.

I'm Choi and I'm Korean.
I'm trying to load and manage a map.

1. I found mapwingis for C#

2. I found video for sample
https://www.youtube.com/watch?v=mBu9XgrfZfM
    In this video, he gets map images with SAS.planet program and 
supplies maps with ms4w.

    After, he loaded the maps in C# project with axmap.

3. I did the sample and it works well.

4. It will take about 200 days to get 20 level's maps with SAS.planet 
program for some area)


5. So, I got new maps about 4TB from https://www.ngii.go.kr/ is 
Korea's National Geographic Information Institute


6. But, I failed to load the new map in sample c# project
    // Source code used in video C# project
    providers.Add(providerid, "map", "http://127.0.0.1/map/z{zoom}/ 
*{y}/{x}*.png", 
tkTileProjection.SphericalMercator, 0, 13);


    // Modified Source code
    providers.Add(providerid, "map", "http://127.0.0.1/map1/z{zoom}/ 
*{x}/{y}*.png", 
tkTileProjection.SphericalMercator, 0, 13);



7. After I found some differences.

    - Sample's map is Google map based EPSG:4326 and file's array is 
{zoom}{y}{x} and image's size 256*256 pixels


    - But my new maps are based EPSG:5179 and files array is 
{zoom}[x]{y} and image's size

512*512 pixels

If someone knows the way to load my new maps with ms4w
Please, let me know.

Thank you!

Best regards
Choi.




___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users