I am a bit new to this GIS thing. I have shapefile that I fed to geoserver in order to retrieve a GeoJson file. I was attempting to display this on openlayers, but it won't show anything. The file is a feature collection of 2450 multipolygons, that is about 2.2 mb big. I tried reducing it to only 3 features, but it does not seem to show anything at all.

However, if I open the browser console, I can see that I did load 3 features, even though they are not painted in the map. I am not sure if they are too small be visible, or if I have to supply a special style for multipolygons.

When I try to load my whole geojson file, it still won't show anything, but in the console I can see that only 50 features were loaded. Moreover they were loaded in a very odd order. Probably because it is stored as a tree.

[42, 34, 24, 36, 33, 31, 22, 43, 44, 21, 28, 47, 16, 49, 32, 40, 39, 19, 38, 50, 25, 37, 27, 1, 2, 3, 9, 8, 12, 10, 11, 7, 5, 18, 20, 45, 41, 23, 35, 30, 26, 4, 17, 48, 15, 14, 29, 6, 13, 46]

So, how can I get it to load more than 50 features? I am using this example as a template, which loads 176 features just fine.

So, what's wrong with those 50 features that won't show up in the map?

Am I missing something? Would a PostGis connection solve this? If so, could you please point me to the right tutorial? I am feeling quite overwhelmed by this :s


It turns out I wasn't able to see any of the 50 features that actually got loaded because I set the wrong projection in geoserver. I still don't know why I am only getting 50 features though.

Better Update: It turns out that geoserver has a setting for maximum number of features set to 50. I disabled that and got the whole set of features that is about 123 mb big!

I am guessing this is a very poor way to get my data read.

  • Alex's points are good, but you could also look at vector tiles (mbtiles, being more or less the standard and TopoJSON, which is a way of compressing JSON (up to 80%, it is claimed), using nodes and arcs, so each linestring is only sent once. Apr 29, 2016 at 6:29

1 Answer 1


If you're wanting to display a lot of data, use WMS, which is a rendered image-based system. And then if you still want to have interactivity, you can do that using vectors.

Check out this: https://github.com/alexgleith/maps-website/blob/master/stormwater.html#L151

This is a pretty complex example, and it uses leaflet rather than openlayers, but the core idea is that you use WMS for viewing and WFS for interactivity.

  • 1
    It is a good example. There are also TopoJSON and vector tiles as alternatives, of course. Apr 29, 2016 at 6:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.