Comments (1)
OK, so I think I have figured this out. It's complicated, so for future reference I'll document what I have found.
OGC:CRS84
(or, more precisely, urn:ogc:def:crs:OGC:1.3:CRS84
) is the identifier of a coordinate reference system (CRS). According to the current GeoJSON standard (RFC 7946), OGC:CRS84
is the CRS used by GeoJSON. However, earlier versions of the GeoJSON standard (in particular the widely used 2008 standard) allow GeoJSON files to specify a custom CRS. That's what my GeoJSON file which caused the problem does:
"crs": {
"properties": {
"name": "urn:ogc:def:crs:OGC:1.3:CRS84"
},
"type": "name"
},
So basically, my GeoJSON file simply explicitly states "Just use the default CRS". However, proj4leaflet sees the custom CRS declaration and passes it own to proj4js which doesn't have that CRS built-in. That's where the exception happens.
Fortunately, the solution is rather easy: proj4js does come with the EPSG:4326
CRS built-in, which differs from OGC:CRS84
only in the order of the coordinates (lon, lat
vs. lat, lon
). Since proj4js assumes lon, lat
order anyways, we can just add OGC:CRS84
as an alias for EPSG:4326
:
proj4.defs['OGC:CRS84'] = proj4.defs['EPSG:4326'];
This fixes the problem for me. Since the proj4leaflet team doesn't want to include that alias in proj4leaflet I think it would be nice to include in ckanext-geoview instead. I'll prepare a PR for that.
from ckanext-geoview.
Related Issues (20)
- map zoomed out and not rendering when loading a page
- common_map WMS configuration wrong parameter HOT 1
- Change feature style in OL geoview
- Local WMS as basemap
- Missing CKAN compatibilty matrix
- Compatibility issue with 2.9 HOT 2
- Compability issue CKAN 2.9 python2 Trying to include unknown asset: <ckanext-geoview/geo-resource-styles_css> HOT 3
- Errors in using geoview HOT 3
- Language translation: Error in re-extraction message when updating translation file
- Geoview throws error everytime on CKAN 2.9 HOT 3
- Problems with geo map visualization HOT 1
- Webassets support for the WMTS preview
- on_same_domain check for WMTS and Shapefile preview
- Problem with extension installation
- No functionality after install HOT 7
- Shapefiles show as line on the top of maps, the .prj file seems not to be read HOT 1
- Layers do not display
- How display map for kml HOT 1
- Leaflet Shapefile won't load HOT 2
- Missing leaflet-providers in the webassets and attributionControl: false in the JS module
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ckanext-geoview.