[mapserver-dev] [mapserver-users] split one geojson into tiles

zach cruise zachc1980 at gmail.com
Tue Sep 8 12:20:55 PDT 2015


i missed your response earlier but what i need is simple:

just like gdal2tiles can create z/x/y tiles for raster data, i want to
create z/x/y tiles for geojson data.

your solution helps with x/y, not z. but i can live with that. as you
said, i can use a point clusterer or polyline/polygon simplifier in
the browser to deal with that. but i was hoping there was another way.

if i use bbox to create geojson tiles, is there a standard library to
recall those tiles in the browser? or should i just write my own
function?

On 8/21/15, TC Haddad <tchaddad at gmail.com> wrote:
> Hi Zach,
>
> Perhaps we need to back up, and have you explain what you are trying to do.
> It would be much easier to help you if your problem was a bit more clear.
> There is maybe an apples and oranges terminology problem where you are
> working with vector data, but seem to be asking a lot of raster data
> questions about x/y/z tiles.
>
> You have a geojson file, and originally you wanted to split it up. But it
> seems you have another goal in mind that you did not mention. My wild guess
> is that you want your data to cluster and uncluster as a user zooms in and
> out on a slippy map. Is that correct?
>
> Unless your geojson is very large, you might be able to accomplish your
> goal simply using Leaflet http://leafletjs.com/ and Leaflet MarkerCluster
> plugin http://leafletjs.com/plugins.html#clusteringdecluttering. Have you
> looked at that?
>
> Mapserver is a server product, and could help in a number of ways on the
> back end, but if you can accomplish what you need on the client side, you
> might not need Mapserver at all.
>
> In order to know for sure, you should describe your goal in more detail.
>
> On Fri, Aug 21, 2015 at 12:48 PM, zach cruise <zachc1980 at gmail.com> wrote:
>
>> i can use bbox with wfs in mapserver. or bbox in ogr2ogr.
>>
>> but it doesn't cluster for zoom levels. eg if i have 10 points at
>> street level, i want it to cluster to show only 1 point at country
>> level.
>>
>> however only bbox might work. but i don't understand how to get bbox
>> info for z/x/y.json. could you explain in detail?
>> http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
>>
>> also is there a seeding operation in mapserver like in geoserver? or
>> should i just use gdal2tiles to create raster tiles?
>>
>> On 8/19/15, TC Haddad <tchaddad at gmail.com> wrote:
>> > On Wed, Aug 19, 2015 at 3:16 PM, zach cruise <zachc1980 at gmail.com>
>> wrote:
>> >
>> >> On 8/19/15, TC Haddad <tchaddad at gmail.com> wrote:
>> >>
>> >
>> >
>> >> > Hi Zach
>> >> >
>> >> > If you set up Mapserver to serve the original geojson layer as WFS
>> >> > service[1] with geojson output [2], you can then pass in the
>> >> > bounding
>> >> boxes
>> >> > (using the WFS URL parameter BBOX=) of the tiles that you want to
>> >> > create.
>> >> >
>> >> > You will get back the resulting geojson tiles as text in the browser
>> >> > and
>> >> > can save them to wherever you want to serve them from.
>> >> >
>> >> > [1] http://mapserver.org/ogc/wfs_server.html
>> >> > [2]
>> >> >
>> >>
>> http://mapserver.org/output/template_output.html#outputformat-declarations
>> >>
>> >> i tried but you can't set zoom levels/precision with wfs [1] and
>> >> geojson
>> >> [2].
>> >>
>> >
>> >
>> > Yes - you must use BBOX= with WFS. You can get all the BBOX info you
>> > need
>> > by using globalmaptiles.py for your area of interest. You can get that
>> > script here:
>> > http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/
>> >
>> >
>> >>
>> >> On 8/19/15, TC Haddad <tchaddad at gmail.com> wrote:
>> >> > OR, a much simpler process would be to use ogr2ogr and skip
>> >> > Mapserver
>> >> > entirely.
>> >> >
>> >> > see the clipping options mentioned here:
>> >> >
>> >> > http://www.gdal.org/ogr2ogr.html
>> >>
>> >> interesting. i tried gdal2tiles but it creates raster not vector
>> >> tiles.
>> >>
>> >
>> >
>> > Yes OGR2OGR is for vector to vector conversions. Spatial extent options
>> can
>> > be passed in using the BBOXes obtained from the same script mentioned
>> > above.


More information about the mapserver-dev mailing list