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.

Some of my data has this position lon: 181 / lat: 91 So when I try to draw them on the Google map:

var geographic = new OpenLayers.Projection("EPSG:4326");
var mercator = new OpenLayers.Projection("EPSG:3857");

var wfsProtocol = new OpenLayers.Protocol.WFS.v1_1_0({ 

               url: GeoServerURL,                  
               featureType: "Vector_Layer", 
       featureNS: "http://mapmap.org", 
       srsName: "EPSG:3857", 
               version: "1.1.0", 
               extractAttributes: true, 
               isBaseLayer: false, 
               visibility: true 
           });

wfsProtocol.read({            
    filter: filter,                      
    callback: processTheQuery, 
    scope: [new OpenLayers.Strategy.BBOX({ 
                   ratio: 1 
               })],
  })



Layer = new OpenLayers.Layer.Vector("test", { 
maxExtent: new OpenLayers.Bounds(-180, -85, 180, 85).transform(geographic,mercator),
displayOutsideMaxExtent: true, 
displayInLayerSwitcher: false 
         })



function processTheQuery(request) {  
if (request.data && request.data.bbox) {
var b = request.data.bbox;   
sExt = new OpenLayers.Bounds(b[0],b[1],b[2],b[3]); 
Layer.destroyFeatures();  
Layer.addFeatures(request.features);
map.zoomToExtent(sExt)

I got this error:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/ows http://myDomain/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows">
  <ows:Exception exceptionCode="NoApplicableCode">
    <ows:ExceptionText>java.lang.IllegalStateException: A transformation exception occurred while reprojecting data on the fly
A transformation exception occurred while reprojecting data on the fly
Latitude 91°00.0'N is too close to a pole.</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>
share|improve this question

closed as too localized by Devdatta Tengshe, whuber Feb 11 '13 at 18:21

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
While wiki.openstreetmap.org/wiki/EPSG:3857 seems to be a "valid" code, your transformation exceeds the legal range (91°N does not exist...). Perhaps this posting is useful? stackoverflow.com/questions/3556966/… –  markusN Feb 10 '13 at 9:36
    
As I understood, EPSG:3857 is the new Google projection instead of EPSG:900913. Unfortunately, nothing changed. –  Shadin Feb 10 '13 at 10:42
add comment

1 Answer 1

up vote 1 down vote accepted

Maybe you didnot understand markusN's Comment, but there is a problem in your data. You have mentioned that some of your data points have latitude as 91N and Longitude as 181.

This is an incorrect position as no such position exists on the earth. The range for Latitude is from +90 to -90 and the range of Longitude is from +180 to -180.

The coordinates of your points fall outside both these ranges. This is why your layer cannot be projected to Web Mercator.

If you check and correct your data, the problem should go away.

share|improve this answer
    
I received these data from its source and I cannot do anything to check if it's correct. The only thing I thought about is finding a way to convert or reproject it but after your reply I understood that there is nothing I can do to fix it. right? –  Shadin Feb 10 '13 at 16:25
1  
@Shadin: Yes. Till you correct these points or delete them, you will continue to get these errors. Garbage in, Garbage out, as they say. –  Devdatta Tengshe Feb 10 '13 at 16:42
    
Thank you for saving my time –  Shadin Feb 10 '13 at 16:50
add comment

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