Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

For a project the map projection is EPSG:32468 (tiles). On top of the map, two or three GeoJSON LineStrings should be displayed using OpenLayers. Each LineString has about 1500 coordinates.

Actually, I would like to store the coordinates of the GeoJSON in lat/lon (EPSG:4326) and then reproject them using OpenLayer's internalProjection and externalProjection, as lat/lon is more "natural"/"human" to think about positions. That is, something like:

var format = new OpenLayers.Format.GeoJSON({
  'internalProjection': new OpenLayers.Projection("EPSG:32468"),
  'externalProjection': new OpenLayers.Projection("EPSG:4326")
});

Are there any performance issues to be expected if doing so? Or should I instead rather reproject the GeoJSONs in advance, e.g. by using ogr2ogr, that is having them already in the special map projection? I do not yet know how many coordinates a LineString will include in future, and importand: the map should also work nicely on iOS 4 (webkit) and recent Android phones.

share|improve this question
    
I would recommend storing all data in same srid which you display it. –  simplexio Apr 19 '13 at 7:25

2 Answers 2

Firstly, no matter what you do, with such large geometries, you will have performance Issues. The map will becomes sluggish and heavy.

Coming to the Projection Issue: lat/lon might appear more "natural"/"human" to you, but the computer does not care. Unless you are going to show the coordinates to the end user, you should use the projection of the Map.

If you store the coordinates in a different projection, they need to be projected to the map's projection and stored in memory. This will definitely affect the performance of your web map.

My suggestion would be to keep your GeoJson data in the same projection as your map, and secondly (more importantly) try to simplify your GeoJSON and remove unnecessary points.

share|improve this answer
    
> "Firstly, no matter what you do, with such large geometries, you will have performance Issues." – What's your experience regarding an upper bound (only as a rule of thumb)? OpenLayers FAQ says ~2500 Coordinates. Do you agree? –  nachtigall Apr 19 '13 at 8:21
    
@nachtigall: That is the upper limit according to OpenLayers. In the real world, where the client's machine might not be powerful enough, the limit for reasonable performance is much less. –  Devdatta Tengshe Apr 19 '13 at 8:28

Whatever the projection you use, in most of the situations it may be a good idea to transform then on the server. That's because the code on the server, for example ogr2ogr or postgis are highly optimized C/C++ code and the transformation is fast, I mean, --really fast--, of an order of tens of thousand transformations/second/core for a simple polygon.

On the other hand, JavaScript is a bit slow for this kind of job and you don't have control over the user's system so, some users with low profile systems or with bad settings may have a disappointing experience.

About the storing system, I had the same doubt, look at this question, basically lat/lon is more efficient if you need to make transformations later.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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