├── .bowerrc ├── .gitignore ├── LICENSE ├── MANIFEST.in ├── README.rst ├── bower.json ├── ckanext ├── __init__.py └── geoview │ ├── __init__.py │ ├── controllers │ ├── __init__.py │ └── service_proxy.py │ ├── plugin │ ├── __init__.py │ ├── flask_plugin.py │ └── pylons_plugin.py │ ├── public │ ├── css │ │ ├── geo-resource-styles.css │ │ ├── geojson_preview.css │ │ ├── ol_preview.css │ │ ├── shp_preview.css │ │ └── wmts_preview.css │ ├── img │ │ ├── blank.gif │ │ ├── gis-resources-sprite-icons.png │ │ └── gis-resources-sprite-icons.psd │ ├── js │ │ ├── common_map.js │ │ ├── geojson_preview.js │ │ ├── ol_preview.js │ │ ├── shp_preview.js │ │ ├── vendor │ │ │ ├── bootstrap2 │ │ │ │ ├── bootstrap.css │ │ │ │ └── bootstrap.js │ │ │ ├── fetch │ │ │ │ ├── .bower.json │ │ │ │ ├── LICENSE │ │ │ │ ├── bower.json │ │ │ │ └── fetch.js │ │ │ ├── jszip │ │ │ │ ├── jszip-utils.js │ │ │ │ └── jszip.js │ │ │ ├── leaflet.spin │ │ │ │ └── leaflet.spin.js │ │ │ ├── leaflet │ │ │ │ ├── .bower.json │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── CONTRIBUTING.md │ │ │ │ ├── Jakefile.js │ │ │ │ ├── LICENSE │ │ │ │ ├── PLUGIN-GUIDE.md │ │ │ │ ├── README.md │ │ │ │ ├── bower.json │ │ │ │ ├── component.json │ │ │ │ ├── dist │ │ │ │ │ ├── images │ │ │ │ │ │ ├── layers-2x.png │ │ │ │ │ │ ├── layers.png │ │ │ │ │ │ ├── marker-icon-2x.png │ │ │ │ │ │ ├── marker-icon.png │ │ │ │ │ │ └── marker-shadow.png │ │ │ │ │ ├── leaflet-src.js │ │ │ │ │ ├── leaflet.css │ │ │ │ │ └── leaflet.js │ │ │ │ └── package.json │ │ │ ├── ol-helpers │ │ │ │ ├── .bower.json │ │ │ │ ├── .gitignore │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── bower.json │ │ │ │ ├── libs │ │ │ │ │ └── swagger-client.js │ │ │ │ ├── ol-helpers.css │ │ │ │ ├── ol-helpers.js │ │ │ │ ├── ol-helpers.less │ │ │ │ └── ol-layer-switcher.js │ │ │ ├── openlayers │ │ │ │ ├── .bower.json │ │ │ │ ├── ol-debug.js │ │ │ │ ├── ol.css │ │ │ │ └── ol.js │ │ │ ├── proj4 │ │ │ │ ├── .bower.json │ │ │ │ ├── AUTHORS │ │ │ │ ├── Gruntfile.js │ │ │ │ ├── LICENSE.md │ │ │ │ ├── PUBLISHING.md │ │ │ │ ├── README.md │ │ │ │ ├── REFERENCES.md │ │ │ │ ├── bower.json │ │ │ │ ├── changelog.md │ │ │ │ ├── component.json │ │ │ │ ├── dist │ │ │ │ │ ├── proj4-src.js │ │ │ │ │ └── proj4.js │ │ │ │ ├── lib │ │ │ │ │ ├── Point.js │ │ │ │ │ ├── Proj.js │ │ │ │ │ ├── adjust_axis.js │ │ │ │ │ ├── common │ │ │ │ │ │ ├── acosh.js │ │ │ │ │ │ ├── adjust_lat.js │ │ │ │ │ │ ├── adjust_lon.js │ │ │ │ │ │ ├── adjust_zone.js │ │ │ │ │ │ ├── asinh.js │ │ │ │ │ │ ├── asinhy.js │ │ │ │ │ │ ├── asinz.js │ │ │ │ │ │ ├── atanh.js │ │ │ │ │ │ ├── clens.js │ │ │ │ │ │ ├── clens_cmplx.js │ │ │ │ │ │ ├── cosh.js │ │ │ │ │ │ ├── e0fn.js │ │ │ │ │ │ ├── e1fn.js │ │ │ │ │ │ ├── e2fn.js │ │ │ │ │ │ ├── e3fn.js │ │ │ │ │ │ ├── fL.js │ │ │ │ │ │ ├── gN.js │ │ │ │ │ │ ├── gatg.js │ │ │ │ │ │ ├── hypot.js │ │ │ │ │ │ ├── imlfn.js │ │ │ │ │ │ ├── inverseNadCvt.js │ │ │ │ │ │ ├── invlatiso.js │ │ │ │ │ │ ├── iqsfnz.js │ │ │ │ │ │ ├── latiso.js │ │ │ │ │ │ ├── log1py.js │ │ │ │ │ │ ├── mlfn.js │ │ │ │ │ │ ├── msfnz.js │ │ │ │ │ │ ├── nadInterBreakout.js │ │ │ │ │ │ ├── nad_cvt.js │ │ │ │ │ │ ├── nad_intr.js │ │ │ │ │ │ ├── phi2z.js │ │ │ │ │ │ ├── pj_enfn.js │ │ │ │ │ │ ├── pj_inv_mlfn.js │ │ │ │ │ │ ├── pj_mlfn.js │ │ │ │ │ │ ├── qsfnz.js │ │ │ │ │ │ ├── sign.js │ │ │ │ │ │ ├── sinh.js │ │ │ │ │ │ ├── srat.js │ │ │ │ │ │ ├── tanh.js │ │ │ │ │ │ ├── toPoint.js │ │ │ │ │ │ └── tsfnz.js │ │ │ │ │ ├── constants │ │ │ │ │ │ ├── Datum.js │ │ │ │ │ │ ├── Ellipsoid.js │ │ │ │ │ │ ├── PrimeMeridian.js │ │ │ │ │ │ ├── units.js │ │ │ │ │ │ └── values.js │ │ │ │ │ ├── core.js │ │ │ │ │ ├── datum.js │ │ │ │ │ ├── datumUtils.js │ │ │ │ │ ├── datum_transform.js │ │ │ │ │ ├── defs.js │ │ │ │ │ ├── deriveConstants.js │ │ │ │ │ ├── extend.js │ │ │ │ │ ├── global.js │ │ │ │ │ ├── includedProjections.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── match.js │ │ │ │ │ ├── parseCode.js │ │ │ │ │ ├── projString.js │ │ │ │ │ ├── projections.js │ │ │ │ │ ├── projections │ │ │ │ │ │ ├── aea.js │ │ │ │ │ │ ├── aeqd.js │ │ │ │ │ │ ├── cass.js │ │ │ │ │ │ ├── cea.js │ │ │ │ │ │ ├── eqc.js │ │ │ │ │ │ ├── eqdc.js │ │ │ │ │ │ ├── equi.js │ │ │ │ │ │ ├── etmerc.js │ │ │ │ │ │ ├── gauss.js │ │ │ │ │ │ ├── gnom.js │ │ │ │ │ │ ├── gstmerc.js │ │ │ │ │ │ ├── krovak.js │ │ │ │ │ │ ├── laea.js │ │ │ │ │ │ ├── lcc.js │ │ │ │ │ │ ├── longlat.js │ │ │ │ │ │ ├── merc.js │ │ │ │ │ │ ├── mill.js │ │ │ │ │ │ ├── moll.js │ │ │ │ │ │ ├── nzmg.js │ │ │ │ │ │ ├── omerc.js │ │ │ │ │ │ ├── ortho.js │ │ │ │ │ │ ├── poly.js │ │ │ │ │ │ ├── sinu.js │ │ │ │ │ │ ├── somerc.js │ │ │ │ │ │ ├── stere.js │ │ │ │ │ │ ├── sterea.js │ │ │ │ │ │ ├── tmerc.js │ │ │ │ │ │ ├── utm.js │ │ │ │ │ │ └── vandg.js │ │ │ │ │ ├── transform.js │ │ │ │ │ └── version.js │ │ │ │ ├── package.json │ │ │ │ ├── projs.js │ │ │ │ └── publish.sh │ │ │ ├── proj4js │ │ │ │ ├── AUTHORS │ │ │ │ ├── LICENSE.md │ │ │ │ ├── README.md │ │ │ │ ├── REFERENCES.md │ │ │ │ └── proj4.js │ │ │ ├── proj4leaflet │ │ │ │ ├── .bower.json │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── bower.json │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ │ └── proj4leaflet.js │ │ │ ├── shp2geojson │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── preprocess.js │ │ │ │ └── preview.js │ │ │ ├── spinjs │ │ │ │ └── spin.js │ │ │ └── underscore │ │ │ │ ├── .bower.json │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── bower.json │ │ │ │ ├── underscore-min.js │ │ │ │ ├── underscore-min.map │ │ │ │ └── underscore.js │ │ └── wmts_preview.js │ ├── resource.config │ └── webassets.yml │ ├── templates │ ├── base.html │ ├── dataviewer │ │ ├── base_form.html │ │ ├── geojson.html │ │ ├── openlayers.html │ │ ├── openlayers_form.html │ │ ├── shp.html │ │ └── wmts.html │ └── geoview │ │ └── snippets │ │ ├── geo-resource-styles_asset.html │ │ ├── geo-resource-styles_resource.html │ │ ├── geojson_asset.html │ │ ├── geojson_resource.html │ │ ├── openlayers_asset.html │ │ ├── openlayers_resource.html │ │ ├── shp_asset.html │ │ ├── shp_resource.html │ │ ├── wmts_asset.html │ │ └── wmts_resource.html │ ├── utils.py │ └── views.py ├── pip-requirements.txt └── setup.py /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "ckanext/geoview/public/js/vendor" 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | *.pyc 3 | *.egg-info 4 | *.swp 5 | *~ 6 | build 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Philippe Duchesne 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.rst 2 | include LICENSE 3 | include bower.json 4 | recursive-include ckanext/geoview *.html *.json *.js *.less *.css *.config *.png *.gif *.jpg *.yml 5 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ckanext-geoview", 3 | "version": "0.0.2", 4 | "dependencies": { 5 | "ol-helpers": "pduchesne/ol-helpers", 6 | "leaflet": "~0.7.7", 7 | "proj4leaflet": "~0.7.2", 8 | "proj4": "^2.3.17" 9 | }, 10 | "appPath": "ckanext/geoview/public", 11 | "resolutions": { 12 | "proj4": "^2.3.17" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ckanext/__init__.py: -------------------------------------------------------------------------------- 1 | # this is a namespace package 2 | try: 3 | import pkg_resources 4 | pkg_resources.declare_namespace(__name__) 5 | except ImportError: 6 | import pkgutil 7 | __path__ = pkgutil.extend_path(__path__, __name__) 8 | -------------------------------------------------------------------------------- /ckanext/geoview/__init__.py: -------------------------------------------------------------------------------- 1 | # this is a namespace package 2 | try: 3 | import pkg_resources 4 | 5 | pkg_resources.declare_namespace(__name__) 6 | except ImportError: 7 | import pkgutil 8 | 9 | __path__ = pkgutil.extend_path(__path__, __name__) 10 | -------------------------------------------------------------------------------- /ckanext/geoview/controllers/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | import pkg_resources 3 | 4 | pkg_resources.declare_namespace(__name__) 5 | except ImportError: 6 | import pkgutil 7 | 8 | __path__ = pkgutil.extend_path(__path__, __name__) 9 | -------------------------------------------------------------------------------- /ckanext/geoview/controllers/service_proxy.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import logging 4 | 5 | import ckan.lib.base as base 6 | 7 | import ckanext.geoview.utils as utils 8 | 9 | 10 | log = logging.getLogger(__name__) 11 | 12 | 13 | class ServiceProxyController(base.BaseController): 14 | def proxy_service(self, resource_id): 15 | data_dict = {"resource_id": resource_id} 16 | context = { 17 | "model": base.model, 18 | "session": base.model.Session, 19 | "user": base.c.user or base.c.author, 20 | } 21 | return utils.proxy_service_resource( 22 | self._py_object.request, context, data_dict 23 | ) 24 | 25 | def proxy_service_url(self, map_id = None): 26 | req = self._py_object.request 27 | if ('ckanext.spatial.common_map.'+map_id+'.url') in base.config: 28 | # backward compatible with old geoview config 29 | url = base.config.get('ckanext.spatial.common_map.'+map_id+'.url') 30 | elif ('ckanext.geoview.basemaps_map') in base.config: 31 | # check if exists in basemaps config 32 | url = base.config['ckanext.geoview.basemaps_map'].get(map_id)['url'] 33 | 34 | return utils.proxy_service_url(self, url) -------------------------------------------------------------------------------- /ckanext/geoview/plugin/flask_plugin.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from ckan import plugins as p 4 | 5 | from ckanext.geoview.views import get_blueprints 6 | 7 | 8 | class GeoViewMixin(p.SingletonPlugin): 9 | p.implements(p.IBlueprint) 10 | 11 | # IBlueprint 12 | 13 | def get_blueprint(self): 14 | return get_blueprints() 15 | -------------------------------------------------------------------------------- /ckanext/geoview/plugin/pylons_plugin.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from ckan import plugins as p 4 | 5 | 6 | class GeoViewMixin(p.SingletonPlugin): 7 | p.implements(p.IRoutes, inherit=True) 8 | 9 | # IRoutes 10 | 11 | def before_map(self, m): 12 | controller = ( 13 | "ckanext.geoview.controllers.service_proxy:ServiceProxyController" 14 | ) 15 | m.connect( 16 | 'service_proxy.proxy_service', 17 | "/dataset/{id}/resource/{resource_id}/service_proxy", 18 | controller=controller, 19 | action="proxy_service", 20 | ) 21 | 22 | m.connect( 23 | 'service_proxy.proxy_service_url', 24 | "/basemap_service/{map_id}", 25 | controller=controller, 26 | action="proxy_service_url", 27 | ) 28 | return m 29 | -------------------------------------------------------------------------------- /ckanext/geoview/public/css/geo-resource-styles.css: -------------------------------------------------------------------------------- 1 | .label[data-format=wfs] { 2 | background-color: #7aae3d; 3 | } 4 | .format-label[data-format=wfs], 5 | .format-label[data-format*=wfs] { 6 | background: url("../../img/gis-resources-sprite-icons.png") no-repeat 0 0; 7 | background-position: 0px -62px; 8 | transform: none; 9 | margin: 0; 10 | width: 32px; 11 | height: 35px; 12 | } 13 | 14 | .label[data-format=wms] { 15 | background-color: #adc717; 16 | } 17 | .format-label[data-format=wms], 18 | .format-label[data-format*=wms] { 19 | background: url("../../img/gis-resources-sprite-icons.png") no-repeat 0 0; 20 | background-position: -32px -62px; 21 | transform: none; 22 | margin: 0; 23 | width: 32px; 24 | height: 35px; 25 | } 26 | 27 | .label[data-format=gml] { 28 | background-color: #7aae3d; 29 | } 30 | .format-label[data-format=gml], 31 | .format-label[data-format*=gml] { 32 | background: url("../../img/gis-resources-sprite-icons.png") no-repeat 0 0; 33 | background-position: -64px -62px; 34 | transform: none; 35 | margin: 0; 36 | width: 32px; 37 | height: 35px; 38 | } 39 | 40 | .label[data-format=kml] { 41 | background-color: #7aae3d; 42 | } 43 | .format-label[data-format=kml], 44 | .format-label[data-format*=kml] { 45 | background: url("../../img/gis-resources-sprite-icons.png") no-repeat 0 0; 46 | background-position: -96px -62px; 47 | transform: none; 48 | margin: 0; 49 | width: 32px; 50 | height: 35px; 51 | } 52 | 53 | .label[data-format=geojson] { 54 | background-color: #9855e0; 55 | } 56 | .format-label[data-format=geojson], 57 | .format-label[data-format*=geojson] { 58 | background: url("../../img/gis-resources-sprite-icons.png") no-repeat 0 0; 59 | background-position: -128px -62px; 60 | transform: none; 61 | margin: 0; 62 | width: 32px; 63 | height: 35px; 64 | } 65 | 66 | .label[data-format=wmts] { 67 | background-color: #3333ff; 68 | } 69 | .format-label[data-format=wmts], 70 | .format-label[data-format*=wmts] { 71 | background: url("../../img/gis-resources-sprite-icons.png") no-repeat 0 0; 72 | background-position: -162px -62px; 73 | transform: none; 74 | margin: 0; 75 | width: 32px; 76 | height: 35px; 77 | } 78 | 79 | .label[data-format=shp] { 80 | background-color: #0080ff; 81 | } 82 | .format-label[data-format=shp], 83 | .format-label[data-format*=shp] { 84 | background: url("../../img/gis-resources-sprite-icons.png") no-repeat 0 0; 85 | background-position: -194px -62px; 86 | transform: none; 87 | margin: 0; 88 | width: 32px; 89 | height: 35px; 90 | } 91 | 92 | .label[data-format=arcgis_rest] { 93 | background-color: #5c3ee0; 94 | } 95 | -------------------------------------------------------------------------------- /ckanext/geoview/public/css/geojson_preview.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | max-height: 600px; 3 | padding: 0; 4 | margin: 0; 5 | background: none; 6 | } 7 | 8 | #map { 9 | position: absolute; 10 | width: 100%; 11 | height: 100%; 12 | } 13 | 14 | #map .table{ 15 | width: 300px; 16 | } 17 | 18 | #map .table-container{ 19 | height: 300px; 20 | overflow: auto; 21 | } 22 | -------------------------------------------------------------------------------- /ckanext/geoview/public/css/ol_preview.css: -------------------------------------------------------------------------------- 1 | #map{ 2 | width: 100%; 3 | height: 600px; 4 | } 5 | 6 | #info { 7 | position: absolute; 8 | height: 1px; 9 | width: 1px; 10 | z-index: 100; 11 | } 12 | .tooltip.in { 13 | opacity: 1; 14 | filter: alpha(opacity=100); 15 | } 16 | .tooltip.top .tooltip-arrow { 17 | border-top-color: white; 18 | } 19 | .tooltip-inner { 20 | border: 2px solid white; 21 | } 22 | 23 | .tooltip-inner>table { 24 | font-size: 80%; 25 | } 26 | 27 | .tooltip-inner td { 28 | text-align: left; 29 | line-height: 90%; 30 | } 31 | 32 | .tooltip-inner>div:first-child { 33 | font-weight: bold; 34 | } 35 | 36 | 37 | /* 38 | #data-preview .ol-viewport .layer-switcher { 39 | position: absolute; 40 | top: 40px; 41 | right: 10px; 42 | } 43 | 44 | #data-preview .ol-viewport .layer-switcher .stacked-layers { 45 | right: 3px; 46 | top: 0px; 47 | } 48 | 49 | 50 | #data-preview .ol-viewport .layer-switcher .header { 51 | padding-right: 43px; 52 | position: initial; 53 | top: 0px; 54 | right: 0px; 55 | } 56 | 57 | #data-preview .ol-viewport .layer-switcher label { 58 | display: inline; 59 | margin-bottom: 5px; 60 | color: white; 61 | } 62 | 63 | #data-preview .ol-viewport .layer-switcher label:before { 64 | content:" "; 65 | } 66 | 67 | #data-preview .ol-viewport .layer-switcher .layer-list ul { 68 | list-style: none; 69 | margin: 0; 70 | } 71 | 72 | #data-preview .ol-viewport .layer-switcher .layer-list { 73 | top: 0px; 74 | right: 0px; 75 | position: initial; 76 | border-radius: 0; 77 | padding: 0; 78 | } 79 | */ 80 | 81 | #data-preview .ol-viewport .popupContainer { 82 | background-color: rgba(0,0,0,0.7); 83 | color: white; 84 | margin-top: 5px; 85 | margin-left: 5px; 86 | font-size: 80%; 87 | border-radius: 4px; 88 | padding: 2px; 89 | line-height: 100%; 90 | box-shadow: 0px 0px 5px 1px white; 91 | } 92 | #data-preview .ol-viewport .popupContainer .popupContent > div { 93 | padding: 3px; 94 | } 95 | 96 | #data-preview .ol-viewport .popupContainer .name { 97 | font-weight: bold; 98 | border-bottom: 1px solid #e5e4e7; 99 | } 100 | 101 | #data-preview .ol-viewport .ol-mouse-position { 102 | background-color: rgba(255,255,255,0.75); 103 | border-radius: 2px; 104 | padding: 1px; 105 | } 106 | 107 | -------------------------------------------------------------------------------- /ckanext/geoview/public/css/shp_preview.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | max-height: 600px; 3 | padding: 0; 4 | margin: 0; 5 | background: none; 6 | } 7 | 8 | #map { 9 | position: absolute; 10 | width: 100%; 11 | height: 100%; 12 | } 13 | 14 | #map .table{ 15 | width: 300px; 16 | } 17 | 18 | #map label { 19 | font-weight: normal; 20 | } 21 | 22 | #map label:after { 23 | content: none; 24 | } 25 | 26 | #map input { 27 | width: auto; 28 | top: auto; 29 | } 30 | 31 | .leaflet-popup-content-wrapper { 32 | box-shadow: 0 1px 7px rgba(0,0,0,0.4); 33 | background: #f8f8f9; 34 | -webkit-border-radius: 5px; 35 | border-radius: 5px; 36 | overflow: auto; 37 | max-height: 200px; 38 | } 39 | -------------------------------------------------------------------------------- /ckanext/geoview/public/css/wmts_preview.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | max-height: 600px; 3 | padding: 0; 4 | margin: 0; 5 | background: none; 6 | } 7 | 8 | #map { 9 | position: absolute; 10 | width: 100%; 11 | height: 100%; 12 | } 13 | 14 | #map .table{ 15 | width: 300px; 16 | } 17 | 18 | #map label { 19 | font-weight: normal; 20 | } 21 | 22 | #map label:after { 23 | content: none; 24 | } 25 | 26 | #map input { 27 | width: auto; 28 | top: auto; 29 | } 30 | 31 | .leaflet-control-layers { 32 | box-shadow: 0 1px 7px rgba(0,0,0,0.4); 33 | background: #f8f8f9; 34 | -webkit-border-radius: 5px; 35 | border-radius: 5px; 36 | overflow: auto; 37 | max-height: 200px; 38 | } 39 | 40 | .ui-opacity { 41 | box-shadow: 0 0 8px rgba(0,0,0,0.4); 42 | background: rgba(255, 255, 255, 0.8); 43 | position: absolute; 44 | left: 13px; 45 | top: 70px; 46 | height: 200px; 47 | width: 22px; 48 | border: 1px solid #888; 49 | border-radius: 5px; 50 | z-index: 1000; 51 | } 52 | 53 | .ui-opacity .handle { 54 | position: absolute; 55 | background: #404040; 56 | left: 0; 57 | top: 20px; 58 | width: 22px; 59 | height: 10px; 60 | border-radius: 1px; 61 | cursor: pointer; 62 | cursor: ns-resize; 63 | } 64 | 65 | .ui-opacity .handle:hover { 66 | background: #303030; 67 | } 68 | -------------------------------------------------------------------------------- /ckanext/geoview/public/img/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pduchesne/ckanext-geoview/18361a47a71ddf41e3393fe97a6c87661e6401f6/ckanext/geoview/public/img/blank.gif -------------------------------------------------------------------------------- /ckanext/geoview/public/img/gis-resources-sprite-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pduchesne/ckanext-geoview/18361a47a71ddf41e3393fe97a6c87661e6401f6/ckanext/geoview/public/img/gis-resources-sprite-icons.png -------------------------------------------------------------------------------- /ckanext/geoview/public/img/gis-resources-sprite-icons.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pduchesne/ckanext-geoview/18361a47a71ddf41e3393fe97a6c87661e6401f6/ckanext/geoview/public/img/gis-resources-sprite-icons.psd -------------------------------------------------------------------------------- /ckanext/geoview/public/js/common_map.js: -------------------------------------------------------------------------------- 1 | (function (ckan, jQuery) { 2 | 3 | /* Returns a Leaflet map to use on the different spatial widgets 4 | * 5 | * All Leaflet based maps should use this constructor to provide consistent 6 | * look and feel and avoid duplication. 7 | * 8 | * container - HTML element or id of the map container 9 | * mapConfig - (Optional) CKAN config related to the base map. 10 | * These are defined in the config ini file (eg 11 | * map type, API keys if necessary, etc). 12 | * leafletMapOptions - (Optional) Options to pass to the Leaflet Map constructor 13 | * leafletBaseLayerOptions - (Optional) Options to pass to the Leaflet TileLayer constructor 14 | * 15 | * Examples 16 | * 17 | * // Will return a map with attribution control 18 | * var map = ckan.commonLeafletMap('map', mapConfig); 19 | * 20 | * // For smaller maps where the attribution is shown outside the map, pass 21 | * // the following option: 22 | * var map = ckan.commonLeafletMap('map', mapConfig, {attributionControl: false}); 23 | * 24 | * Returns a Leaflet map object. 25 | */ 26 | ckan.commonLeafletMap = function (container, 27 | mapConfig, 28 | leafletMapOptions, 29 | leafletBaseLayerOptions) { 30 | 31 | var isHttps = window.location.href.substring(0, 5).toLowerCase() === 'https'; 32 | var mapConfig = mapConfig || {type: 'stamen'}; 33 | var leafletMapOptions = leafletMapOptions || {}; 34 | var leafletBaseLayerOptions = jQuery.extend(leafletBaseLayerOptions, { 35 | maxZoom: 18 36 | }); 37 | 38 | map = new L.Map(container, leafletMapOptions); 39 | 40 | if (mapConfig.type == 'mapbox') { 41 | // MapBox base map 42 | if (!mapConfig['mapbox.map_id'] || !mapConfig['mapbox.access_token']) { 43 | throw '[CKAN Map Widgets] You need to provide a map ID ([account].[handle]) and an access token when using a MapBox layer. ' + 44 | 'See http://www.mapbox.com/developers/api-overview/ for details'; 45 | } 46 | 47 | baseLayerUrl = '//{s}.tiles.mapbox.com/v4/' + mapConfig['mapbox.map_id'] + '/{z}/{x}/{y}.png?access_token=' + mapConfig['mapbox.access_token']; 48 | leafletBaseLayerOptions.handle = mapConfig['mapbox.map_id']; 49 | leafletBaseLayerOptions.subdomains = mapConfig.subdomains || 'abcd'; 50 | leafletBaseLayerOptions.attribution = mapConfig.attribution || 'Data: OpenStreetMap, Design: MapBox'; 51 | } else if (mapConfig.type == 'custom') { 52 | // Custom XYZ layer 53 | baseLayerUrl = mapConfig['custom.url']; 54 | if (!baseLayerUrl) 55 | throw '[CKAN Map Widgets] Custom URL must be set when using Custom Map type'; 56 | 57 | if (mapConfig.subdomains) leafletBaseLayerOptions.subdomains = mapConfig.subdomains; 58 | if (mapConfig.tms) leafletBaseLayerOptions.tms = mapConfig.tms; 59 | leafletBaseLayerOptions.attribution = mapConfig.attribution; 60 | } else { 61 | // Default to Stamen base map 62 | baseLayerUrl = 'https://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png'; 63 | leafletBaseLayerOptions.subdomains = mapConfig.subdomains || 'abcd'; 64 | leafletBaseLayerOptions.attribution = mapConfig.attribution || 'Map tiles by Stamen Design (CC BY 3.0). Data by OpenStreetMap (CC BY SA)'; 65 | } 66 | 67 | var baseLayer = new L.TileLayer(baseLayerUrl, leafletBaseLayerOptions); 68 | map.addLayer(baseLayer); 69 | 70 | return map; 71 | 72 | } 73 | 74 | })(this.ckan, this.jQuery); 75 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/geojson_preview.js: -------------------------------------------------------------------------------- 1 | // geojson preview module 2 | ckan.module('geojsonpreview', function (jQuery, _) { 3 | return { 4 | options: { 5 | table: '
{body}
', 6 | row:'{key}{value}', 7 | style: { 8 | opacity: 0.7, 9 | fillOpacity: 0.1, 10 | weight: 2 11 | }, 12 | i18n: { 13 | 'error': _('An error occurred: %(text)s %(error)s'), 14 | 'file_too_big': _('This GeoJSON file is too big to be previewed. Please download it locally.') 15 | } 16 | }, 17 | initialize: function () { 18 | var self = this; 19 | 20 | self.el.empty(); 21 | 22 | if (this.options.max_file_size !== 'None' && preload_resource.size && 23 | preload_resource.size > this.options.max_file_size) { 24 | var msg = this.i18n('file_too_big'); 25 | self.el.append($("

" + msg + "

")); 26 | return 27 | } 28 | 29 | 30 | 31 | self.el.append($("
").attr("id","map")); 32 | self.map = ckan.commonLeafletMap('map', this.options.map_config); 33 | 34 | // hack to make leaflet use a particular location to look for images 35 | L.Icon.Default.imagePath = this.options.site_url + 'js/vendor/leaflet/dist/images'; 36 | 37 | jQuery.getJSON(preload_resource['url']).done( 38 | function(data){ 39 | self.showPreview(data); 40 | }) 41 | .fail( 42 | function(jqXHR, textStatus, errorThrown) { 43 | self.showError(jqXHR, textStatus, errorThrown); 44 | } 45 | ); 46 | 47 | // The standard CRS for GeoJSON according to RFC 7946 is 48 | // urn:ogc:def:crs:OGC::CRS84, but proj4s uses a different name 49 | // for it. See https://github.com/ckan/ckanext-geoview/issues/51 50 | proj4.defs['OGC:CRS84'] = proj4.defs['EPSG:4326']; 51 | }, 52 | 53 | showError: function (jqXHR, textStatus, errorThrown) { 54 | if (textStatus == 'error' && jqXHR.responseText.length) { 55 | this.el.html(jqXHR.responseText); 56 | } else { 57 | this.el.html(this.i18n('error', {text: textStatus, error: errorThrown})); 58 | } 59 | }, 60 | 61 | showPreview: function (geojsonFeature) { 62 | var self = this; 63 | var gjLayer = L.Proj.geoJson(geojsonFeature, { 64 | style: self.options.style, 65 | onEachFeature: function(feature, layer) { 66 | var body = ''; 67 | if (feature.properties) { 68 | jQuery.each(feature.properties, function(key, value){ 69 | if (value != null && typeof value === 'object') { 70 | value = JSON.stringify(value); 71 | } 72 | body += L.Util.template(self.options.row, {key: key, value: value}); 73 | }); 74 | var popupContent = L.Util.template(self.options.table, {body: body}); 75 | layer.bindPopup(popupContent); 76 | } 77 | } 78 | }).addTo(self.map); 79 | self.map.fitBounds(gjLayer.getBounds()); 80 | } 81 | }; 82 | }); 83 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/shp_preview.js: -------------------------------------------------------------------------------- 1 | // shapefile preview module 2 | ckan.module('shppreview', function (jQuery, _) { 3 | return { 4 | options: { 5 | table: '{body}
', 6 | row:'{key}{value}', 7 | style: { 8 | fillColor: '#03F', 9 | opacity: 0.7, 10 | fillOpacity: 0.1, 11 | weight: 2 12 | }, 13 | i18n: { 14 | 'error': _('An error occurred: %(text)s %(error)s') 15 | } 16 | }, 17 | initialize: function () { 18 | var self = this; 19 | 20 | self.el.empty(); 21 | self.el.append($('
').attr('id', 'map')); 22 | self.map = ckan.commonLeafletMap('map', this.options.map_config); 23 | 24 | // hack to make leaflet use a particular location to look for images 25 | L.Icon.Default.imagePath = this.options.site_url + 'js/vendor/leaflet/dist/images'; 26 | 27 | jQuery.get(preload_resource['url']).done( 28 | function(data){ 29 | self.showPreview(preload_resource['url']); 30 | }) 31 | .fail( 32 | function(jqXHR, textStatus, errorThrown) { 33 | self.showError(jqXHR, textStatus, errorThrown); 34 | } 35 | ); 36 | }, 37 | 38 | showError: function (jqXHR, textStatus, errorThrown) { 39 | if (textStatus == 'error' && jqXHR.responseText.length) { 40 | this.el.html(jqXHR.responseText); 41 | } else { 42 | this.el.html(this.i18n('error', {text: textStatus, error: errorThrown})); 43 | } 44 | }, 45 | 46 | showPreview: function (url) { 47 | var self = this; 48 | var encoding, crs; 49 | 50 | function highLightStyle(e) { 51 | gjLayer.eachLayer(function(l) { 52 | gjLayer.resetStyle(l); 53 | }); 54 | if('setStyle' in e.target) e.target.setStyle({ 55 | fillColor: '#FF0', 56 | fillOpacity: 0.6 57 | }); 58 | } 59 | 60 | self.map.spin(true); 61 | var gjLayer = L.geoJson([], { 62 | style: self.options.style, 63 | onEachFeature: function(feature, layer) { 64 | var body = ''; 65 | jQuery.each(feature.properties, function(key, value) { 66 | if (value != null && typeof value === 'object') { 67 | value = JSON.stringify(value); 68 | } 69 | body += L.Util.template(self.options.row, {key: key, value: value}); 70 | }); 71 | var popupContent = L.Util.template(self.options.table, {body: body}); 72 | layer.bindPopup(popupContent); 73 | layer.on({click: highLightStyle}); 74 | } 75 | }).addTo(self.map); 76 | 77 | if (preload_resource.encoding) 78 | encoding = preload_resource.encoding; 79 | else if (this.options.shp_config.encoding) 80 | encoding = this.options.shp_config.encoding; 81 | else 82 | encoding = 'utf-8'; 83 | 84 | if (preload_resource.resource_crs) 85 | crs = preload_resource.resource_crs; 86 | else if (this.options.shp_config.srid) 87 | crs = this.options.shp_config.srid; 88 | else 89 | crs = '4326'; 90 | 91 | loadshp({ 92 | url: url, 93 | encoding: encoding, 94 | EPSG: crs 95 | }, function(data) { 96 | gjLayer.addData(data); 97 | self.map.fitBounds(gjLayer.getBounds()); 98 | self.map.spin(false); 99 | }); 100 | } 101 | } 102 | }); 103 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/fetch/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fetch", 3 | "main": "fetch.js", 4 | "ignore": [ 5 | ".*", 6 | "*.md", 7 | "examples/", 8 | "Makefile", 9 | "package.json", 10 | "script/", 11 | "test/" 12 | ], 13 | "homepage": "https://github.com/github/fetch", 14 | "version": "2.0.3", 15 | "_release": "2.0.3", 16 | "_resolution": { 17 | "type": "version", 18 | "tag": "v2.0.3", 19 | "commit": "7e7e5c5b535fdc4abb245382307c8056c1907ecf" 20 | }, 21 | "_source": "https://github.com/github/fetch.git", 22 | "_target": "^2.0.3", 23 | "_originalSource": "fetch" 24 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/fetch/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2016 GitHub, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/fetch/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fetch", 3 | "main": "fetch.js", 4 | "ignore": [ 5 | ".*", 6 | "*.md", 7 | "examples/", 8 | "Makefile", 9 | "package.json", 10 | "script/", 11 | "test/" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/jszip/jszip-utils.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.JSZipUtils=a():"undefined"!=typeof global?global.JSZipUtils=a():"undefined"!=typeof self&&(self.JSZipUtils=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g.github.io/`. 42 | 43 | ### Readme 44 | 45 | The next thing you need to have is a descriptive `README.md` in the root of the repo (or a link to a website with a similar content). 46 | At a minimum it should contain the following items: 47 | 48 | - name of the plugin 49 | - a simple, concise description of what it does 50 | - requirements 51 | - Leaflet version 52 | - other external dependencies (if any) 53 | - browser / device compatibility 54 | - links to demos 55 | - instructions for including the plugin 56 | - simple usage code example 57 | - API reference (methods, options, events) 58 | 59 | ### License 60 | 61 | Every open source repository should include a license. 62 | If you don't know what open source license to choose for your code, 63 | [MIT License](http://opensource.org/licenses/MIT) and [BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause) are both good choices. 64 | You can either put it in the repo as a `LICENSE` file or just link to the license from the Readme. 65 | 66 | ## Code 67 | 68 | ### File Structure 69 | 70 | Keep the file structure clean and simple, 71 | don't pile up lots of files in one place — 72 | make it easy for a new person to find their way in your repo. 73 | 74 | A barebones repo for a simple plugin would look like this: 75 | 76 | ``` 77 | my-plugin.js 78 | README.md 79 | ``` 80 | 81 | An example of a more sophisticated plugin file structure: 82 | 83 | ``` 84 | /src - JS source files 85 | /dist - minified plugin JS, CSS, images 86 | /spec - test files 87 | /lib - any external libraries/plugins if necessary 88 | /examples - HTML examples of plugin usage 89 | README.md 90 | LICENSE 91 | package.json 92 | ``` 93 | 94 | ### Code Conventions 95 | 96 | Everyone's tastes are different, but it's important to be consistent with whatever conventions you choose for your plugin. 97 | 98 | For a good starting point, check out [Airbnb JavaScript Guide](https://github.com/airbnb/javascript). 99 | Leaflet follows pretty much the same conventions 100 | except for using smart tabs (hard tabs for indentation, spaces for alignment) 101 | and putting a space after the `function` keyword. 102 | 103 | ### Plugin API 104 | 105 | Never expose global variables in your plugin.
106 | If you have a new class, put it directly in the `L` namespace (`L.MyPlugin`).
107 | If you inherit one of the existing classes, make it a sub-property (`L.TileLayer.Banana`).
108 | If you want to add new methods to existing Leaflet classes, you can do it like this: `L.Marker.include({myPlugin: …})`. 109 | 110 | Function, method and property names should be in `camelCase`.
111 | Class names should be in `CapitalizedCamelCase`. 112 | 113 | If you have a lot of arguments in your function, consider accepting an options object instead 114 | (putting default values where possible so that users don't need specify all of them): 115 | 116 | ```js 117 | // bad 118 | marker.myPlugin('bla', 'foo', null, {}, 5, 0); 119 | 120 | // good 121 | marker.myPlugin('bla', { 122 | optionOne: 'foo', 123 | optionThree: 5 124 | }); 125 | ``` 126 | 127 | And most importantly, keep it simple. Leaflet is all about *simplicity*. 128 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/leaflet/README.md: -------------------------------------------------------------------------------- 1 | Leaflet 2 | 3 | Leaflet is an open source JavaScript library for **mobile-friendly interactive maps**. 4 | It is developed by [Vladimir Agafonkin][] of [MapBox][] with a team of dedicated [contributors][]. 5 | Weighing just about 30 KB of gzipped JS code, it has all the [features][] most developers ever need for online maps. 6 | 7 | Leaflet is designed with *simplicity*, *performance* and *usability* in mind. 8 | It works efficiently across all major desktop and mobile platforms out of the box, 9 | taking advantage of HTML5 and CSS3 on modern browsers while being accessible on older ones too. 10 | It can be extended with a huge amount of [plugins][], 11 | has a beautiful, easy to use and [well-documented][] API 12 | and a simple, readable [source code][] that is a joy to [contribute][] to. 13 | 14 | For more info, docs and tutorials, check out the [official website][].
15 | For **Leaflet downloads** (including the built master version), check out the [download page][]. 16 | 17 | We're happy to meet new contributors. 18 | If you want to **get involved** with Leaflet development, check out the [contribution guide][contribute]. 19 | Let's make the best mapping library that will ever exist, 20 | and push the limits of what's possible with online maps! 21 | 22 | [![Build Status](https://travis-ci.org/Leaflet/Leaflet.png?branch=master)](https://travis-ci.org/Leaflet/Leaflet) 23 | 24 | [Vladimir Agafonkin]: http://agafonkin.com/en 25 | [contributors]: https://github.com/Leaflet/Leaflet/graphs/contributors 26 | [features]: http://leafletjs.com/features.html 27 | [plugins]: http://leafletjs.com/plugins.html 28 | [well-documented]: http://leafletjs.com/reference.html "Leaflet API reference" 29 | [source code]: https://github.com/Leaflet/Leaflet "Leaflet GitHub repository" 30 | [hosted on GitHub]: http://github.com/Leaflet/Leaflet 31 | [contribute]: https://github.com/Leaflet/Leaflet/blob/master/CONTRIBUTING.md "A guide to contributing to Leaflet" 32 | [official website]: http://leafletjs.com 33 | [download page]: http://leafletjs.com/download.html 34 | [MapBox]: https://mapbox.com 35 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/leaflet/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "leaflet", 3 | "version": "0.7.7", 4 | "description": "JavaScript library for mobile-friendly interactive maps", 5 | "main": [ 6 | "dist/leaflet.css", 7 | "dist/leaflet-src.js", 8 | "dist/images/layers-2x.png", 9 | "dist/images/layers.png", 10 | "dist/images/marker-icon-2x.png", 11 | "dist/images/marker-icon.png", 12 | "dist/images/marker-shadow.png" 13 | ], 14 | "ignore": [ 15 | ".*", 16 | "CHANGELOG.json", 17 | "FAQ.md", 18 | "debug", 19 | "spec", 20 | "src", 21 | "build" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/leaflet/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "leaflet", 3 | "version": "0.7.7", 4 | "description": "JavaScript library for mobile-friendly interactive maps", 5 | "scripts": [ 6 | "dist/leaflet.js", 7 | "dist/leaflet-src.js" 8 | ], 9 | "images": [ 10 | "dist/images/layers-2x.png", 11 | "dist/images/layers.png", 12 | "dist/images/marker-icon-2x.png", 13 | "dist/images/marker-icon.png", 14 | "dist/images/marker-shadow.png" 15 | ], 16 | "styles": [ 17 | "dist/leaflet.css" 18 | ], 19 | "main": "dist/leaflet-src.js" 20 | } 21 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/leaflet/dist/images/layers-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pduchesne/ckanext-geoview/18361a47a71ddf41e3393fe97a6c87661e6401f6/ckanext/geoview/public/js/vendor/leaflet/dist/images/layers-2x.png -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/leaflet/dist/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pduchesne/ckanext-geoview/18361a47a71ddf41e3393fe97a6c87661e6401f6/ckanext/geoview/public/js/vendor/leaflet/dist/images/layers.png -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/leaflet/dist/images/marker-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pduchesne/ckanext-geoview/18361a47a71ddf41e3393fe97a6c87661e6401f6/ckanext/geoview/public/js/vendor/leaflet/dist/images/marker-icon-2x.png -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/leaflet/dist/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pduchesne/ckanext-geoview/18361a47a71ddf41e3393fe97a6c87661e6401f6/ckanext/geoview/public/js/vendor/leaflet/dist/images/marker-icon.png -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/leaflet/dist/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pduchesne/ckanext-geoview/18361a47a71ddf41e3393fe97a6c87661e6401f6/ckanext/geoview/public/js/vendor/leaflet/dist/images/marker-shadow.png -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/leaflet/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "leaflet", 3 | "version": "0.7.7", 4 | "description": "JavaScript library for mobile-friendly interactive maps", 5 | "devDependencies": { 6 | "copyfiles": "^0.2.1", 7 | "happen": "~0.2.0", 8 | "jake": "~8.0.12", 9 | "jshint": "~2.8.0", 10 | "karma": "~0.13.14", 11 | "karma-chrome-launcher": "^0.2.1", 12 | "karma-coverage": "~0.5.3", 13 | "karma-mocha": "~0.2.0", 14 | "karma-phantomjs-launcher": "^0.2.1", 15 | "mocha": "~2.3.3", 16 | "tin": "^0.5.0", 17 | "uglify-js": "~2.5.0" 18 | }, 19 | "main": "dist/leaflet-src.js", 20 | "scripts": { 21 | "test": "jake test", 22 | "build": "jake build", 23 | "release": "./build/publish.sh" 24 | }, 25 | "repository": { 26 | "type": "git", 27 | "url": "git://github.com/Leaflet/Leaflet.git" 28 | }, 29 | "keywords": [ 30 | "gis", 31 | "map" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/ol-helpers/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ol-helpers", 3 | "description": "Handy glue code for Openlayers", 4 | "keywords": [ 5 | "openlayers", 6 | "geo", 7 | "web" 8 | ], 9 | "main": [ 10 | "ol-helpers.js", 11 | "ol-layer-switcher.js", 12 | "ol-helpers.css" 13 | ], 14 | "dependencies": { 15 | "underscore": ">=1.4.2", 16 | "openlayers": "https://github.com/openlayers/openlayers/releases/download/v4.2.0/v4.2.0-dist.zip", 17 | "fetch": "^2.0.3" 18 | }, 19 | "homepage": "https://github.com/pduchesne/ol-helpers", 20 | "_release": "6cf084b385", 21 | "_resolution": { 22 | "type": "branch", 23 | "branch": "master", 24 | "commit": "6cf084b3858eed5ddd18b5a2958b3de436428664" 25 | }, 26 | "_source": "https://github.com/pduchesne/ol-helpers.git", 27 | "_target": "*", 28 | "_originalSource": "pduchesne/ol-helpers" 29 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/ol-helpers/.gitignore: -------------------------------------------------------------------------------- 1 | bower_components -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/ol-helpers/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Philippe Duchesne 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/ol-helpers/README.md: -------------------------------------------------------------------------------- 1 | ol-helpers 2 | ========== 3 | 4 | Handy glue code for OpenLayers 5 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/ol-helpers/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ol-helpers", 3 | "description": "Handy glue code for Openlayers", 4 | "version": "4.0.0", 5 | "keywords": [ 6 | "openlayers", 7 | "geo", 8 | "web" 9 | ], 10 | "main": [ 11 | "ol-helpers.js", 12 | "ol-layer-switcher.js", 13 | "ol-helpers.css" 14 | ], 15 | "dependencies": { 16 | "underscore": ">=1.4.2", 17 | "openlayers": "https://github.com/openlayers/openlayers/releases/download/v4.2.0/v4.2.0-dist.zip", 18 | "fetch": "^2.0.3" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/openlayers/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openlayers", 3 | "_cacheHeaders": { 4 | "ETag": "\"a3bfbcfb09f40999c70cf760ad58c110\"", 5 | "Last-Modified": "Mon, 12 Jun 2017 14:54:48 GMT", 6 | "Content-Length": "589693", 7 | "Content-Type": "application/octet-stream", 8 | "Content-Disposition": "attachment; filename=v4.2.0-dist.zip" 9 | }, 10 | "_release": "e-tag:a3bfbcfb0", 11 | "_source": "https://github.com/openlayers/openlayers/releases/download/v4.2.0/v4.2.0-dist.zip", 12 | "_target": "*", 13 | "_originalSource": "https://github.com/openlayers/openlayers/releases/download/v4.2.0/v4.2.0-dist.zip" 14 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/openlayers/ol.css: -------------------------------------------------------------------------------- 1 | .ol-box{box-sizing:border-box;border-radius:2px;border:2px solid #00f}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:rgba(0,60,136,.3);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width}.ol-overlay-container{will-change:left,right,top,bottom}.ol-unsupported{display:none}.ol-unselectable,.ol-viewport{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:rgba(255,255,255,.4);border-radius:4px;padding:2px}.ol-control:hover{background-color:rgba(255,255,255,.6)}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}@media print{.ol-control{display:none}}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-size:1.14em;font-weight:700;text-decoration:none;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:rgba(0,60,136,.5);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:focus,.ol-control button:hover{text-decoration:none;background-color:rgba(0,60,136,.7)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em)}.ol-attribution ul{margin:0;padding:0 .5em;font-size:.7rem;line-height:1.375em;color:#000;text-shadow:0 0 2px #fff}.ol-attribution li{display:inline;list-style:none;line-height:inherit}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button,.ol-attribution ul{display:inline-block}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution.ol-logo-only ul{display:block}.ol-attribution:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0;height:1.1em;line-height:1em}.ol-attribution.ol-logo-only{background:0 0;bottom:.4em;height:1.1em;line-height:1em}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-logo-only button,.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:inline-block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:1px;left:2px;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move} -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "proj4", 3 | "version": "2.4.4", 4 | "description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.", 5 | "homepage": "https://github.com/proj4js/proj4js", 6 | "main": "dist/proj4.js", 7 | "keywords": [ 8 | "gis", 9 | "projections", 10 | "geospatial", 11 | "transform", 12 | "datum" 13 | ], 14 | "license": "MIT", 15 | "ignore": [ 16 | "**/.*", 17 | "node_modules", 18 | "bower_components", 19 | "test", 20 | "tests", 21 | "almond", 22 | "src" 23 | ], 24 | "_release": "2.4.4", 25 | "_resolution": { 26 | "type": "version", 27 | "tag": "2.4.4", 28 | "commit": "e0fc90bb256d5b296c2ec9af923158d0fee847c5" 29 | }, 30 | "_source": "https://github.com/proj4js/proj4js.git", 31 | "_target": "^2.3.17", 32 | "_originalSource": "proj4" 33 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/AUTHORS: -------------------------------------------------------------------------------- 1 | Mike Adair 2 | Richard Greenwood 3 | Calvin Metcalf 4 | Richard Marsden (http://www.winwaed.com) 5 | #credit for 6 | #src/projCode/gnom.js 7 | #src/projCode/cea.js 8 | T. Mittan 9 | #credit for 10 | #src/projCode/eqdc.js 11 | #src/projCode/equi.js 12 | #src/projCode/merc.js 13 | #src/projCode/mill.js 14 | #src/projCode/omerc.js 15 | #src/projCode/ortho.js 16 | #src/projCode/poly.js 17 | #src/projCode/poly.js 18 | D. Steinwand 19 | #credit for 20 | #src/projCode/merc.js 21 | #src/projCode/laea.js 22 | #src/projCode/moll.js 23 | S. Nelson 24 | #credit for 25 | #src/projCode/moll.js -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/Gruntfile.js: -------------------------------------------------------------------------------- 1 | var json = require('rollup-plugin-json'); 2 | var nodeResolve = require('rollup-plugin-node-resolve'); 3 | 4 | var projs = [ 5 | 'tmerc', 6 | 'etmerc', 7 | 'utm', 8 | 'sterea', 9 | 'stere', 10 | 'somerc', 11 | 'omerc', 12 | 'lcc', 13 | 'krovak', 14 | 'cass', 15 | 'laea', 16 | 'aea', 17 | 'gnom', 18 | 'cea', 19 | 'eqc', 20 | 'poly', 21 | 'nzmg', 22 | 'mill', 23 | 'sinu', 24 | 'moll', 25 | 'eqdc', 26 | 'vandg', 27 | 'aeqd', 28 | 'ortho', 29 | 'qsc' 30 | ]; 31 | module.exports = function(grunt) { 32 | grunt.initConfig({ 33 | pkg: grunt.file.readJSON('package.json'), 34 | connect: { 35 | server: { 36 | options: { 37 | port: process.env.PORT || 8080, 38 | base: '.' 39 | } 40 | } 41 | }, 42 | mocha_phantomjs: { 43 | all: { 44 | options: { 45 | reporter: "dot", 46 | urls: [ //my ide requries process.env.IP and PORT 47 | "http://" + (process.env.IP || "127.0.0.1") + ":" + (process.env.PORT || "8080") + "/test/amd.html", 48 | "http://" + (process.env.IP || "127.0.0.1") + ":" + (process.env.PORT || "8080") + "/test/opt.html" 49 | ] 50 | } 51 | } 52 | }, 53 | jshint: { 54 | options: { 55 | jshintrc: "./.jshintrc" 56 | }, 57 | all: ['./lib/*.js', './lib/*/*.js'] 58 | }, 59 | rollup: { 60 | options: { 61 | format: "umd", 62 | moduleName: "proj4", 63 | plugins: [ 64 | json(), 65 | nodeResolve() 66 | ] 67 | }, 68 | files: { 69 | dest: './dist/proj4-src.js', 70 | src: './lib/index.js', 71 | }, 72 | }, 73 | uglify: { 74 | options: { 75 | report: 'gzip', 76 | mangle:{ 77 | except: ['proj4','Projection','Point'] 78 | }, 79 | }, 80 | all: { 81 | src: 'dist/proj4-src.js', 82 | dest: 'dist/proj4.js' 83 | } 84 | } 85 | }); 86 | grunt.loadNpmTasks('grunt-rollup'); 87 | grunt.loadNpmTasks('grunt-contrib-uglify'); 88 | grunt.loadNpmTasks('grunt-contrib-jshint'); 89 | grunt.loadNpmTasks('grunt-contrib-connect'); 90 | grunt.loadNpmTasks('grunt-mocha-phantomjs'); 91 | grunt.registerTask('custom',function(){ 92 | grunt.task.run('rollup', 'uglify'); 93 | var projections = this.args; 94 | if(projections[0]==='default'){ 95 | grunt.file.write('./projs.js','export default function(){}'); 96 | return; 97 | } 98 | if(projections[0]==='all'){ 99 | projections = projs; 100 | } 101 | grunt.file.write('./projs.js',[ 102 | projections.map(function(proj) { 103 | return "import " + proj + " from './lib/projections/" + proj + "';"; 104 | }).join("\n"), 105 | "export default function(proj4){", 106 | projections.map(function(proj) { 107 | return " proj4.Proj.projections.add(" + proj + ");" 108 | }).join("\n"), 109 | "}" 110 | ].join("\n")); 111 | }); 112 | grunt.registerTask('build',function(){ 113 | var args = this.args.length?this.args[0].split(','):['default']; 114 | grunt.task.run('jshint', 'custom:'+args.join(':')); 115 | }); 116 | grunt.registerTask('default', ['build:all', 'connect','mocha_phantomjs']); 117 | }; 118 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/LICENSE.md: -------------------------------------------------------------------------------- 1 | ##Proj4js -- Javascript reprojection library. 2 | 3 | Authors: 4 | - Mike Adair madairATdmsolutions.ca 5 | - Richard Greenwood richATgreenwoodmap.com 6 | - Didier Richard didier.richardATign.fr 7 | - Stephen Irons stephen.ironsATclear.net.nz 8 | - Olivier Terral oterralATgmail.com 9 | - Calvin Metcalf cmetcalfATappgeo.com 10 | 11 | Copyright (c) 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf 12 | 13 | Permission is hereby granted, free of charge, to any person obtaining a 14 | copy of this software and associated documentation files (the "Software"), 15 | to deal in the Software without restriction, including without limitation 16 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 17 | and/or sell copies of the Software, and to permit persons to whom the 18 | Software is furnished to do so, subject to the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be included 21 | in all copies or substantial portions of the Software. 22 | 23 | _THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 24 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 26 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 28 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 29 | DEALINGS IN THE SOFTWARE._ -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/PUBLISHING.md: -------------------------------------------------------------------------------- 1 | Publishing 2 | === 3 | 4 | Use `tin` to update the version number in the `package.json`, `component.json` & `bower.json`. 5 | 6 | tin -v x.y.z 7 | 8 | Then run the publish script 9 | 10 | ./publish.sh 11 | 12 | afterwards don't forget to update the versions to be a prerelease of the next version, so if you just published 1.1.1 then: 13 | 14 | tin -v 1.1.2-alpha 15 | git add package.json component.json bower.json 16 | git commit -m 'update version to 1.1.2-alpha' 17 | git push origin master -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/REFERENCES.md: -------------------------------------------------------------------------------- 1 | 1. Snyder, John P., "Map Projections--A Working Manual", U.S. Geological Survey 2 | Professional Paper 1395 (Supersedes USGS Bulletin 1532), 3 | United States Government Printing Office, Washington D.C., 1987. 4 | Accessed: 2016-05-09. https://pubs.er.usgs.gov/publication/pp1395 5 | 2. Snyder, John P. and Voxland, Philip M., "An Album of Map Projections", 6 | U.S. Geological Survey Professional Paper 1453 , 7 | United State Government Printing Office, Washington D.C., 1989. 8 | Accessed: 2016-05-09. https://pubs.er.usgs.gov/publication/pp1453 9 | 3. "Cartographic Projection Procedures for the UNIX Environment- 10 | A User's Manual" by Gerald I. Evenden, 11 | USGS Open File Report 90-284 and Release 4 Interim Reports (2003). 12 | Accessed: 2016-06-09. http://www2.bren.ucsb.edu/~frew/ESM264/private/proj_manual.pdf 13 | 4. Snyder, John P., "Flattening the Earth - 14 | Two Thousand Years of Map Projections", Univ. Chicago Press, 1993 15 | 5. Wolfram Mathworld "Gnomonic Projection" 16 | http://mathworld.wolfram.com/GnomonicProjection.html 17 | Accessed: 12th November 2009 18 | 6. "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder, 19 | The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355. 20 | 7. Snyder, John P., "Map Projections--A Working Manual", U.S. Geological 21 | Survey Professional Paper 1395 (Supersedes USGS Bulletin 1532), United 22 | State Government Printing Office, Washington D.C., 1987. 23 | Access date 2016-05-09. https://pubs.er.usgs.gov/publication/pp1395 24 | 8. "Software Documentation for GCTP General Cartographic Transformation 25 | Package", U.S. Geological Survey National Mapping Division, May 1982. 26 | 9. Department of Land and Survey Technical Circular 1973/32 27 | http://www.linz.govt.nz/docs/miscellaneous/nz-map-definition.pdf 28 | 10. OSG Technical Report 4.1 29 | http://www.linz.govt.nz/docs/miscellaneous/nzmg.pdf 30 | 11. Formules et constantes pour le Calcul pour la 31 | projection cylindrique conforme à axe oblique et pour la transformation entre 32 | des systèmes de référence. 33 | http://www.swisstopo.admin.ch/internet/swisstopo/fr/home/topics/survey/sys/refsys/switzerland.parsysrelated1.31216.downloadList.77004.DownloadFile.tmp/swissprojectionfr.pdf 34 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "proj4", 3 | "version": "2.4.4-alpha", 4 | "description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.", 5 | "homepage": "https://github.com/proj4js/proj4js", 6 | "main": "dist/proj4.js", 7 | "keywords": [ 8 | "gis", 9 | "projections", 10 | "geospatial", 11 | "transform", 12 | "datum" 13 | ], 14 | "license": "MIT", 15 | "ignore": [ 16 | "**/.*", 17 | "node_modules", 18 | "bower_components", 19 | "test", 20 | "tests", 21 | "almond", 22 | "src" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/changelog.md: -------------------------------------------------------------------------------- 1 | Change log 2 | === 3 | - 2.2.1: Documentation fixes and added proj4.defs('name') as an alias for proj4.defs['name']; 4 | 5 | - 2.1.4: dist folder is added back in after accidentally omitting it in 2.1.1 6 | 7 | - 2.1.3: skipped as issues with the dist folder are ironed out. 8 | 9 | - 2.1.2: added sensible defaults for false eastings/northings 10 | 11 | - 2.1.1: tweaks to how we publish it, fixes related to errors with the OSGB36 and Reseau National Belge 1972 datums, we took the first steps towards depreciating the proj4.Point class. 12 | 13 | - 2.1.0: targeted builds for projections are now supported, and internally projection creation is more modular. 14 | 15 | - 2.0.3: mgrs is broken out into it's own module loaded via npm. 16 | 17 | - 2.0.2: module common is broken up into a collection of smaller modules. 18 | 19 | - 2.0.1: fix typo in eqc projection. 20 | 21 | - 2.0.0: we start the change log. -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "proj4", 3 | "version": "2.4.4-alpha", 4 | "description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.", 5 | "repo": "proj4js/proj4js", 6 | "keywords": [ 7 | "projections", 8 | "proj4", 9 | "transform", 10 | "crs" 11 | ], 12 | "license": "MIT", 13 | "main": "dist/proj4.js", 14 | "scripts": [ 15 | "dist/proj4.js" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/Point.js: -------------------------------------------------------------------------------- 1 | import {toPoint, forward} from 'mgrs'; 2 | 3 | function Point(x, y, z) { 4 | if (!(this instanceof Point)) { 5 | return new Point(x, y, z); 6 | } 7 | if (Array.isArray(x)) { 8 | this.x = x[0]; 9 | this.y = x[1]; 10 | this.z = x[2] || 0.0; 11 | } else if(typeof x === 'object') { 12 | this.x = x.x; 13 | this.y = x.y; 14 | this.z = x.z || 0.0; 15 | } else if (typeof x === 'string' && typeof y === 'undefined') { 16 | var coords = x.split(','); 17 | this.x = parseFloat(coords[0], 10); 18 | this.y = parseFloat(coords[1], 10); 19 | this.z = parseFloat(coords[2], 10) || 0.0; 20 | } else { 21 | this.x = x; 22 | this.y = y; 23 | this.z = z || 0.0; 24 | } 25 | console.warn('proj4.Point will be removed in version 3, use proj4.toPoint'); 26 | } 27 | 28 | Point.fromMGRS = function(mgrsStr) { 29 | return new Point(toPoint(mgrsStr)); 30 | }; 31 | Point.prototype.toMGRS = function(accuracy) { 32 | return forward([this.x, this.y], accuracy); 33 | }; 34 | export default Point; 35 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/Proj.js: -------------------------------------------------------------------------------- 1 | import parseCode from './parseCode'; 2 | import extend from './extend'; 3 | import projections from './projections'; 4 | import {sphere as dc_sphere, eccentricity as dc_eccentricity} from './deriveConstants'; 5 | import Datum from './constants/Datum'; 6 | import datum from './datum'; 7 | import match from './match'; 8 | 9 | function Projection(srsCode,callback) { 10 | if (!(this instanceof Projection)) { 11 | return new Projection(srsCode); 12 | } 13 | callback = callback || function(error){ 14 | if(error){ 15 | throw error; 16 | } 17 | }; 18 | var json = parseCode(srsCode); 19 | if(typeof json !== 'object'){ 20 | callback(srsCode); 21 | return; 22 | } 23 | var ourProj = Projection.projections.get(json.projName); 24 | if(!ourProj){ 25 | callback(srsCode); 26 | return; 27 | } 28 | if (json.datumCode && json.datumCode !== 'none') { 29 | var datumDef = match(Datum, json.datumCode); 30 | if (datumDef) { 31 | json.datum_params = datumDef.towgs84 ? datumDef.towgs84.split(',') : null; 32 | json.ellps = datumDef.ellipse; 33 | json.datumName = datumDef.datumName ? datumDef.datumName : json.datumCode; 34 | } 35 | } 36 | json.k0 = json.k0 || 1.0; 37 | json.axis = json.axis || 'enu'; 38 | json.ellps = json.ellps || 'wgs84'; 39 | var sphere_ = dc_sphere(json.a, json.b, json.rf, json.ellps, json.sphere); 40 | var ecc = dc_eccentricity(sphere_.a, sphere_.b, sphere_.rf, json.R_A); 41 | var datumObj = json.datum || datum(json.datumCode, json.datum_params, sphere_.a, sphere_.b, ecc.es, ecc.ep2); 42 | 43 | extend(this, json); // transfer everything over from the projection because we don't know what we'll need 44 | extend(this, ourProj); // transfer all the methods from the projection 45 | 46 | // copy the 4 things over we calulated in deriveConstants.sphere 47 | this.a = sphere_.a; 48 | this.b = sphere_.b; 49 | this.rf = sphere_.rf; 50 | this.sphere = sphere_.sphere; 51 | 52 | // copy the 3 things we calculated in deriveConstants.eccentricity 53 | this.es = ecc.es; 54 | this.e = ecc.e; 55 | this.ep2 = ecc.ep2; 56 | 57 | // add in the datum object 58 | this.datum = datumObj; 59 | 60 | // init the projection 61 | this.init(); 62 | 63 | // legecy callback from back in the day when it went to spatialreference.org 64 | callback(null, this); 65 | 66 | } 67 | Projection.projections = projections; 68 | Projection.projections.start(); 69 | export default Projection; 70 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/adjust_axis.js: -------------------------------------------------------------------------------- 1 | export default function(crs, denorm, point) { 2 | var xin = point.x, 3 | yin = point.y, 4 | zin = point.z || 0.0; 5 | var v, t, i; 6 | var out = {}; 7 | for (i = 0; i < 3; i++) { 8 | if (denorm && i === 2 && point.z === undefined) { 9 | continue; 10 | } 11 | if (i === 0) { 12 | v = xin; 13 | t = 'x'; 14 | } 15 | else if (i === 1) { 16 | v = yin; 17 | t = 'y'; 18 | } 19 | else { 20 | v = zin; 21 | t = 'z'; 22 | } 23 | switch (crs.axis[i]) { 24 | case 'e': 25 | out[t] = v; 26 | break; 27 | case 'w': 28 | out[t] = -v; 29 | break; 30 | case 'n': 31 | out[t] = v; 32 | break; 33 | case 's': 34 | out[t] = -v; 35 | break; 36 | case 'u': 37 | if (point[t] !== undefined) { 38 | out.z = v; 39 | } 40 | break; 41 | case 'd': 42 | if (point[t] !== undefined) { 43 | out.z = -v; 44 | } 45 | break; 46 | default: 47 | //console.log("ERROR: unknow axis ("+crs.axis[i]+") - check definition of "+crs.projName); 48 | return null; 49 | } 50 | } 51 | return out; 52 | } 53 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/acosh.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | return 2 * Math.log(Math.sqrt((x + 1) / 2) + Math.sqrt((x - 1) / 2)); 3 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/adjust_lat.js: -------------------------------------------------------------------------------- 1 | import {HALF_PI} from '../constants/values'; 2 | import sign from './sign'; 3 | 4 | export default function(x) { 5 | return (Math.abs(x) < HALF_PI) ? x : (x - (sign(x) * Math.PI)); 6 | } 7 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/adjust_lon.js: -------------------------------------------------------------------------------- 1 | 2 | import {TWO_PI, SPI} from '../constants/values'; 3 | import sign from './sign'; 4 | 5 | export default function(x) { 6 | return (Math.abs(x) <= SPI) ? x : (x - (sign(x) * TWO_PI)); 7 | } 8 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/adjust_zone.js: -------------------------------------------------------------------------------- 1 | import adjust_lon from './adjust_lon'; 2 | 3 | export default function(zone, lon) { 4 | if (zone === undefined) { 5 | zone = Math.floor((adjust_lon(lon) + Math.PI) * 30 / Math.PI) + 1; 6 | 7 | if (zone < 0) { 8 | return 0; 9 | } else if (zone > 60) { 10 | return 60; 11 | } 12 | } 13 | return zone; 14 | } 15 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/asinh.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | var s = (x >= 0 ? 1 : -1); 3 | return s * (Math.log(Math.abs(x) + Math.sqrt(x * x + 1))); 4 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/asinhy.js: -------------------------------------------------------------------------------- 1 | import hypot from './hypot'; 2 | import log1py from './log1py'; 3 | 4 | export default function(x) { 5 | var y = Math.abs(x); 6 | y = log1py(y * (1 + y / (hypot(1, y) + 1))); 7 | 8 | return x < 0 ? -y : y; 9 | } 10 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/asinz.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | if (Math.abs(x) > 1) { 3 | x = (x > 1) ? 1 : -1; 4 | } 5 | return Math.asin(x); 6 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/atanh.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | return Math.log((x - 1) / (x + 1)) / 2; 3 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/clens.js: -------------------------------------------------------------------------------- 1 | export default function(pp, arg_r) { 2 | var r = 2 * Math.cos(arg_r); 3 | var i = pp.length - 1; 4 | var hr1 = pp[i]; 5 | var hr2 = 0; 6 | var hr; 7 | 8 | while (--i >= 0) { 9 | hr = -hr2 + r * hr1 + pp[i]; 10 | hr2 = hr1; 11 | hr1 = hr; 12 | } 13 | 14 | return Math.sin(arg_r) * hr; 15 | } 16 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/clens_cmplx.js: -------------------------------------------------------------------------------- 1 | import sinh from './sinh'; 2 | import cosh from './cosh'; 3 | 4 | export default function(pp, arg_r, arg_i) { 5 | var sin_arg_r = Math.sin(arg_r); 6 | var cos_arg_r = Math.cos(arg_r); 7 | var sinh_arg_i = sinh(arg_i); 8 | var cosh_arg_i = cosh(arg_i); 9 | var r = 2 * cos_arg_r * cosh_arg_i; 10 | var i = -2 * sin_arg_r * sinh_arg_i; 11 | var j = pp.length - 1; 12 | var hr = pp[j]; 13 | var hi1 = 0; 14 | var hr1 = 0; 15 | var hi = 0; 16 | var hr2; 17 | var hi2; 18 | 19 | while (--j >= 0) { 20 | hr2 = hr1; 21 | hi2 = hi1; 22 | hr1 = hr; 23 | hi1 = hi; 24 | hr = -hr2 + r * hr1 - i * hi1 + pp[j]; 25 | hi = -hi2 + i * hr1 + r * hi1; 26 | } 27 | 28 | r = sin_arg_r * cosh_arg_i; 29 | i = cos_arg_r * sinh_arg_i; 30 | 31 | return [r * hr - i * hi, r * hi + i * hr]; 32 | } 33 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/cosh.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | var r = Math.exp(x); 3 | r = (r + 1 / r) / 2; 4 | return r; 5 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/e0fn.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | return (1 - 0.25 * x * (1 + x / 16 * (3 + 1.25 * x))); 3 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/e1fn.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | return (0.375 * x * (1 + 0.25 * x * (1 + 0.46875 * x))); 3 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/e2fn.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | return (0.05859375 * x * x * (1 + 0.75 * x)); 3 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/e3fn.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | return (x * x * x * (35 / 3072)); 3 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/fL.js: -------------------------------------------------------------------------------- 1 | import {HALF_PI} from '../constants/values'; 2 | 3 | export default function(x, L) { 4 | return 2 * Math.atan(x * Math.exp(L)) - HALF_PI; 5 | } 6 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/gN.js: -------------------------------------------------------------------------------- 1 | export default function(a, e, sinphi) { 2 | var temp = e * sinphi; 3 | return a / Math.sqrt(1 - temp * temp); 4 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/gatg.js: -------------------------------------------------------------------------------- 1 | export default function(pp, B) { 2 | var cos_2B = 2 * Math.cos(2 * B); 3 | var i = pp.length - 1; 4 | var h1 = pp[i]; 5 | var h2 = 0; 6 | var h; 7 | 8 | while (--i >= 0) { 9 | h = -h2 + cos_2B * h1 + pp[i]; 10 | h2 = h1; 11 | h1 = h; 12 | } 13 | 14 | return (B + h * Math.sin(2 * B)); 15 | } 16 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/hypot.js: -------------------------------------------------------------------------------- 1 | export default function(x, y) { 2 | x = Math.abs(x); 3 | y = Math.abs(y); 4 | var a = Math.max(x, y); 5 | var b = Math.min(x, y) / (a ? a : 1); 6 | 7 | return a * Math.sqrt(1 + Math.pow(b, 2)); 8 | } 9 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/imlfn.js: -------------------------------------------------------------------------------- 1 | export default function(ml, e0, e1, e2, e3) { 2 | var phi; 3 | var dphi; 4 | 5 | phi = ml / e0; 6 | for (var i = 0; i < 15; i++) { 7 | dphi = (ml - (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi))) / (e0 - 2 * e1 * Math.cos(2 * phi) + 4 * e2 * Math.cos(4 * phi) - 6 * e3 * Math.cos(6 * phi)); 8 | phi += dphi; 9 | if (Math.abs(dphi) <= 0.0000000001) { 10 | return phi; 11 | } 12 | } 13 | 14 | //..reportError("IMLFN-CONV:Latitude failed to converge after 15 iterations"); 15 | return NaN; 16 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/inverseNadCvt.js: -------------------------------------------------------------------------------- 1 | import nad_intr from './nad_intr'; 2 | import adjust_lon from './adjust_lon'; 3 | 4 | export default function(t, val, tb, ct) { 5 | if (isNaN(t.x)) { 6 | return val; 7 | } 8 | t.x = tb.x + t.x; 9 | t.y = tb.y - t.y; 10 | var i = 9, 11 | tol = 1e-12; 12 | var dif, del; 13 | do { 14 | del = nad_intr(t, ct); 15 | if (isNaN(del.x)) { 16 | break; 17 | } 18 | dif = { 19 | "x": t.x - del.x - tb.x, 20 | "y": t.y + del.y - tb.y 21 | }; 22 | t.x -= dif.x; 23 | t.y -= dif.y; 24 | } while (i-- && Math.abs(dif.x) > tol && Math.abs(dif.y) > tol); 25 | if (i < 0) { 26 | return val; 27 | } 28 | val.x = adjust_lon(t.x + ct.ll[0]); 29 | val.y = t.y + ct.ll[1]; 30 | return val; 31 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/invlatiso.js: -------------------------------------------------------------------------------- 1 | import fL from './fL'; 2 | 3 | export default function(eccent, ts) { 4 | var phi = fL(1, ts); 5 | var Iphi = 0; 6 | var con = 0; 7 | do { 8 | Iphi = phi; 9 | con = eccent * Math.sin(Iphi); 10 | phi = fL(Math.exp(eccent * Math.log((1 + con) / (1 - con)) / 2), ts); 11 | } while (Math.abs(phi - Iphi) > 1.0e-12); 12 | return phi; 13 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/iqsfnz.js: -------------------------------------------------------------------------------- 1 | import {HALF_PI} from '../constants/values'; 2 | 3 | export default function(eccent, q) { 4 | var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math.log((1 - eccent) / (1 + eccent)); 5 | if (Math.abs(Math.abs(q) - temp) < 1.0E-6) { 6 | if (q < 0) { 7 | return (-1 * HALF_PI); 8 | } 9 | else { 10 | return HALF_PI; 11 | } 12 | } 13 | //var phi = 0.5* q/(1-eccent*eccent); 14 | var phi = Math.asin(0.5 * q); 15 | var dphi; 16 | var sin_phi; 17 | var cos_phi; 18 | var con; 19 | for (var i = 0; i < 30; i++) { 20 | sin_phi = Math.sin(phi); 21 | cos_phi = Math.cos(phi); 22 | con = eccent * sin_phi; 23 | dphi = Math.pow(1 - con * con, 2) / (2 * cos_phi) * (q / (1 - eccent * eccent) - sin_phi / (1 - con * con) + 0.5 / eccent * Math.log((1 - con) / (1 + con))); 24 | phi += dphi; 25 | if (Math.abs(dphi) <= 0.0000000001) { 26 | return phi; 27 | } 28 | } 29 | 30 | //console.log("IQSFN-CONV:Latitude failed to converge after 30 iterations"); 31 | return NaN; 32 | } 33 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/latiso.js: -------------------------------------------------------------------------------- 1 | import {HALF_PI} from '../constants/values'; 2 | 3 | export default function(eccent, phi, sinphi) { 4 | if (Math.abs(phi) > HALF_PI) { 5 | return Number.NaN; 6 | } 7 | if (phi === HALF_PI) { 8 | return Number.POSITIVE_INFINITY; 9 | } 10 | if (phi === -1 * HALF_PI) { 11 | return Number.NEGATIVE_INFINITY; 12 | } 13 | 14 | var con = eccent * sinphi; 15 | return Math.log(Math.tan((HALF_PI + phi) / 2)) + eccent * Math.log((1 - con) / (1 + con)) / 2; 16 | } 17 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/log1py.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | var y = 1 + x; 3 | var z = y - 1; 4 | 5 | return z === 0 ? x : x * Math.log(y) / z; 6 | } 7 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/mlfn.js: -------------------------------------------------------------------------------- 1 | export default function(e0, e1, e2, e3, phi) { 2 | return (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi)); 3 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/msfnz.js: -------------------------------------------------------------------------------- 1 | export default function(eccent, sinphi, cosphi) { 2 | var con = eccent * sinphi; 3 | return cosphi / (Math.sqrt(1 - con * con)); 4 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/nadInterBreakout.js: -------------------------------------------------------------------------------- 1 | export default function(indx, frct, letter, number, ct) { 2 | var inx; 3 | if (indx[letter] < 0) { 4 | if (!(indx[letter] === -1 && frct[letter] > 0.99999999999)) { 5 | return false; 6 | } 7 | indx[letter]++; 8 | frct[letter] = 0; 9 | } 10 | else { 11 | inx = indx[letter] + 1; 12 | if (inx >= ct.lim[number]) { 13 | if (!(inx === ct.lim[number] && frct[letter] < 1e-11)) { 14 | return false; 15 | } 16 | if (letter === 'x') { 17 | indx[letter]--; 18 | } 19 | else { 20 | indx[letter]++; 21 | } 22 | frct[letter] = 1; 23 | } 24 | } 25 | return [indx, frct]; 26 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/nad_cvt.js: -------------------------------------------------------------------------------- 1 | import adjust_lon from './adjust_lon'; 2 | import nad_intr from './nad_intr'; 3 | import inverseNadCvt from './inverseNadCvt'; 4 | 5 | export default function(pin, inverse, ct) { 6 | var val = { 7 | "x": Number.NaN, 8 | "y": Number.NaN 9 | }; 10 | if (isNaN(pin.x)) { 11 | return val; 12 | } 13 | var tb = { 14 | "x": pin.x, 15 | "y": pin.y 16 | }; 17 | tb.x -= ct.ll[0]; 18 | tb.y -= ct.ll[1]; 19 | tb.x = adjust_lon(tb.x - Math.PI) + Math.PI; 20 | var t = nad_intr(tb, ct); 21 | if (inverse) { 22 | return inverseNadCvt(t, val, tb, ct); 23 | } 24 | else { 25 | if (!isNaN(t.x)) { 26 | val.x = pin.x - t.x; 27 | val.y = pin.y + t.y; 28 | } 29 | } 30 | return val; 31 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/nad_intr.js: -------------------------------------------------------------------------------- 1 | import nadInterBreakout from "./nadInterBreakout"; 2 | 3 | export default function(pin, ct) { 4 | // force computation by decreasing by 1e-7 to be as closed as possible 5 | // from computation under C:C++ by leveraging rounding problems ... 6 | var t = { 7 | x: (pin.x - 1e-7) / ct.del[0], 8 | y: (pin.y - 1e-7) / ct.del[1] 9 | }; 10 | var indx = { 11 | x: Math.floor(t.x), 12 | y: Math.floor(t.y) 13 | }; 14 | var frct = { 15 | x: t.x - 1 * indx.x, 16 | y: t.y - 1 * indx.y 17 | }; 18 | var val = { 19 | x: Number.NaN, 20 | y: Number.NaN 21 | }; 22 | 23 | 24 | var temp = nadInterBreakout(indx, frct, 'x', 0, ct); 25 | if (temp) { 26 | indx = temp[0]; 27 | frct = temp[1]; 28 | } 29 | else { 30 | return val; 31 | } 32 | temp = nadInterBreakout(indx, frct, 'y', 1, ct); 33 | if (temp) { 34 | indx = temp[0]; 35 | frct = temp[1]; 36 | } 37 | else { 38 | return val; 39 | } 40 | var inx = (indx.y * ct.lim[0]) + indx.x; 41 | var f00 = { 42 | x: ct.cvs[inx][0], 43 | y: ct.cvs[inx][1] 44 | }; 45 | inx++; 46 | var f10 = { 47 | x: ct.cvs[inx][0], 48 | y: ct.cvs[inx][1] 49 | }; 50 | inx += ct.lim[0]; 51 | var f11 = { 52 | x: ct.cvs[inx][0], 53 | y: ct.cvs[inx][1] 54 | }; 55 | inx--; 56 | var f01 = { 57 | x: ct.cvs[inx][0], 58 | y: ct.cvs[inx][1] 59 | }; 60 | var m11 = frct.x * frct.y, 61 | m10 = frct.x * (1 - frct.y), 62 | m00 = (1 - frct.x) * (1 - frct.y), 63 | m01 = (1 - frct.x) * frct.y; 64 | val.x = (m00 * f00.x + m10 * f10.x + m01 * f01.x + m11 * f11.x); 65 | val.y = (m00 * f00.y + m10 * f10.y + m01 * f01.y + m11 * f11.y); 66 | return val; 67 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/phi2z.js: -------------------------------------------------------------------------------- 1 | import {HALF_PI} from '../constants/values'; 2 | 3 | export default function(eccent, ts) { 4 | var eccnth = 0.5 * eccent; 5 | var con, dphi; 6 | var phi = HALF_PI - 2 * Math.atan(ts); 7 | for (var i = 0; i <= 15; i++) { 8 | con = eccent * Math.sin(phi); 9 | dphi = HALF_PI - 2 * Math.atan(ts * (Math.pow(((1 - con) / (1 + con)), eccnth))) - phi; 10 | phi += dphi; 11 | if (Math.abs(dphi) <= 0.0000000001) { 12 | return phi; 13 | } 14 | } 15 | //console.log("phi2z has NoConvergence"); 16 | return -9999; 17 | } 18 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/pj_enfn.js: -------------------------------------------------------------------------------- 1 | var C00 = 1; 2 | var C02 = 0.25; 3 | var C04 = 0.046875; 4 | var C06 = 0.01953125; 5 | var C08 = 0.01068115234375; 6 | var C22 = 0.75; 7 | var C44 = 0.46875; 8 | var C46 = 0.01302083333333333333; 9 | var C48 = 0.00712076822916666666; 10 | var C66 = 0.36458333333333333333; 11 | var C68 = 0.00569661458333333333; 12 | var C88 = 0.3076171875; 13 | 14 | export default function(es) { 15 | var en = []; 16 | en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08))); 17 | en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08))); 18 | var t = es * es; 19 | en[2] = t * (C44 - es * (C46 + es * C48)); 20 | t *= es; 21 | en[3] = t * (C66 - es * C68); 22 | en[4] = t * es * C88; 23 | return en; 24 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/pj_inv_mlfn.js: -------------------------------------------------------------------------------- 1 | import pj_mlfn from "./pj_mlfn"; 2 | import {EPSLN} from '../constants/values'; 3 | 4 | var MAX_ITER = 20; 5 | 6 | export default function(arg, es, en) { 7 | var k = 1 / (1 - es); 8 | var phi = arg; 9 | for (var i = MAX_ITER; i; --i) { /* rarely goes over 2 iterations */ 10 | var s = Math.sin(phi); 11 | var t = 1 - es * s * s; 12 | //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg; 13 | //phi -= t * (t * Math.sqrt(t)) * k; 14 | t = (pj_mlfn(phi, s, Math.cos(phi), en) - arg) * (t * Math.sqrt(t)) * k; 15 | phi -= t; 16 | if (Math.abs(t) < EPSLN) { 17 | return phi; 18 | } 19 | } 20 | //..reportError("cass:pj_inv_mlfn: Convergence error"); 21 | return phi; 22 | } 23 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/pj_mlfn.js: -------------------------------------------------------------------------------- 1 | export default function(phi, sphi, cphi, en) { 2 | cphi *= sphi; 3 | sphi *= sphi; 4 | return (en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4])))); 5 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/qsfnz.js: -------------------------------------------------------------------------------- 1 | export default function(eccent, sinphi) { 2 | var con; 3 | if (eccent > 1.0e-7) { 4 | con = eccent * sinphi; 5 | return ((1 - eccent * eccent) * (sinphi / (1 - con * con) - (0.5 / eccent) * Math.log((1 - con) / (1 + con)))); 6 | } 7 | else { 8 | return (2 * sinphi); 9 | } 10 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/sign.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | return x<0 ? -1 : 1; 3 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/sinh.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | var r = Math.exp(x); 3 | r = (r - 1 / r) / 2; 4 | return r; 5 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/srat.js: -------------------------------------------------------------------------------- 1 | export default function(esinp, exp) { 2 | return (Math.pow((1 - esinp) / (1 + esinp), exp)); 3 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/tanh.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | var r = Math.exp(x); 3 | r = (r - 1 / r) / (r + 1 / r); 4 | return r; 5 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/toPoint.js: -------------------------------------------------------------------------------- 1 | export default function (array){ 2 | var out = { 3 | x: array[0], 4 | y: array[1] 5 | }; 6 | if (array.length>2) { 7 | out.z = array[2]; 8 | } 9 | if (array.length>3) { 10 | out.m = array[3]; 11 | } 12 | return out; 13 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/common/tsfnz.js: -------------------------------------------------------------------------------- 1 | import {HALF_PI} from '../constants/values'; 2 | 3 | export default function(eccent, phi, sinphi) { 4 | var con = eccent * sinphi; 5 | var com = 0.5 * eccent; 6 | con = Math.pow(((1 - con) / (1 + con)), com); 7 | return (Math.tan(0.5 * (HALF_PI - phi)) / con); 8 | } 9 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/constants/Datum.js: -------------------------------------------------------------------------------- 1 | var exports = {}; 2 | export {exports as default}; 3 | exports.wgs84 = { 4 | towgs84: "0,0,0", 5 | ellipse: "WGS84", 6 | datumName: "WGS84" 7 | }; 8 | 9 | exports.ch1903 = { 10 | towgs84: "674.374,15.056,405.346", 11 | ellipse: "bessel", 12 | datumName: "swiss" 13 | }; 14 | 15 | exports.ggrs87 = { 16 | towgs84: "-199.87,74.79,246.62", 17 | ellipse: "GRS80", 18 | datumName: "Greek_Geodetic_Reference_System_1987" 19 | }; 20 | 21 | exports.nad83 = { 22 | towgs84: "0,0,0", 23 | ellipse: "GRS80", 24 | datumName: "North_American_Datum_1983" 25 | }; 26 | 27 | exports.nad27 = { 28 | nadgrids: "@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat", 29 | ellipse: "clrk66", 30 | datumName: "North_American_Datum_1927" 31 | }; 32 | 33 | exports.potsdam = { 34 | towgs84: "606.0,23.0,413.0", 35 | ellipse: "bessel", 36 | datumName: "Potsdam Rauenberg 1950 DHDN" 37 | }; 38 | 39 | exports.carthage = { 40 | towgs84: "-263.0,6.0,431.0", 41 | ellipse: "clark80", 42 | datumName: "Carthage 1934 Tunisia" 43 | }; 44 | 45 | exports.hermannskogel = { 46 | towgs84: "653.0,-212.0,449.0", 47 | ellipse: "bessel", 48 | datumName: "Hermannskogel" 49 | }; 50 | 51 | exports.osni52 = { 52 | towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15", 53 | ellipse: "airy", 54 | datumName: "Irish National" 55 | }; 56 | 57 | exports.ire65 = { 58 | towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15", 59 | ellipse: "mod_airy", 60 | datumName: "Ireland 1965" 61 | }; 62 | 63 | exports.rassadiran = { 64 | towgs84: "-133.63,-157.5,-158.62", 65 | ellipse: "intl", 66 | datumName: "Rassadiran" 67 | }; 68 | 69 | exports.nzgd49 = { 70 | towgs84: "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993", 71 | ellipse: "intl", 72 | datumName: "New Zealand Geodetic Datum 1949" 73 | }; 74 | 75 | exports.osgb36 = { 76 | towgs84: "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894", 77 | ellipse: "airy", 78 | datumName: "Airy 1830" 79 | }; 80 | 81 | exports.s_jtsk = { 82 | towgs84: "589,76,480", 83 | ellipse: 'bessel', 84 | datumName: 'S-JTSK (Ferro)' 85 | }; 86 | 87 | exports.beduaram = { 88 | towgs84: '-106,-87,188', 89 | ellipse: 'clrk80', 90 | datumName: 'Beduaram' 91 | }; 92 | 93 | exports.gunung_segara = { 94 | towgs84: '-403,684,41', 95 | ellipse: 'bessel', 96 | datumName: 'Gunung Segara Jakarta' 97 | }; 98 | 99 | exports.rnb72 = { 100 | towgs84: "106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1", 101 | ellipse: "intl", 102 | datumName: "Reseau National Belge 1972" 103 | }; 104 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/constants/PrimeMeridian.js: -------------------------------------------------------------------------------- 1 | var exports = {}; 2 | export {exports as default}; 3 | 4 | exports.greenwich = 0.0; //"0dE", 5 | exports.lisbon = -9.131906111111; //"9d07'54.862\"W", 6 | exports.paris = 2.337229166667; //"2d20'14.025\"E", 7 | exports.bogota = -74.080916666667; //"74d04'51.3\"W", 8 | exports.madrid = -3.687938888889; //"3d41'16.58\"W", 9 | exports.rome = 12.452333333333; //"12d27'8.4\"E", 10 | exports.bern = 7.439583333333; //"7d26'22.5\"E", 11 | exports.jakarta = 106.807719444444; //"106d48'27.79\"E", 12 | exports.ferro = -17.666666666667; //"17d40'W", 13 | exports.brussels = 4.367975; //"4d22'4.71\"E", 14 | exports.stockholm = 18.058277777778; //"18d3'29.8\"E", 15 | exports.athens = 23.7163375; //"23d42'58.815\"E", 16 | exports.oslo = 10.722916666667; //"10d43'22.5\"E" 17 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/constants/units.js: -------------------------------------------------------------------------------- 1 | export default { 2 | ft: {to_meter: 0.3048}, 3 | 'us-ft': {to_meter: 1200 / 3937} 4 | }; 5 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/constants/values.js: -------------------------------------------------------------------------------- 1 | export var PJD_3PARAM = 1; 2 | export var PJD_7PARAM = 2; 3 | export var PJD_WGS84 = 4; // WGS84 or equivalent 4 | export var PJD_NODATUM = 5; // WGS84 or equivalent 5 | export var SEC_TO_RAD = 4.84813681109535993589914102357e-6; 6 | export var HALF_PI = Math.PI/2; 7 | // ellipoid pj_set_ell.c 8 | export var SIXTH = 0.1666666666666666667; 9 | /* 1/6 */ 10 | export var RA4 = 0.04722222222222222222; 11 | /* 17/360 */ 12 | export var RA6 = 0.02215608465608465608; 13 | export var EPSLN = 1.0e-10; 14 | // you'd think you could use Number.EPSILON above but that makes 15 | // Mollweide get into an infinate loop. 16 | 17 | export var D2R = 0.01745329251994329577; 18 | export var R2D = 57.29577951308232088; 19 | export var FORTPI = Math.PI/4; 20 | export var TWO_PI = Math.PI * 2; 21 | // SPI is slightly greater than Math.PI, so values that exceed the -180..180 22 | // degree range by a tiny amount don't get wrapped. This prevents points that 23 | // have drifted from their original location along the 180th meridian (due to 24 | // floating point error) from changing their sign. 25 | export var SPI = 3.14159265359; 26 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/core.js: -------------------------------------------------------------------------------- 1 | import proj from './Proj'; 2 | import transform from './transform'; 3 | var wgs84 = proj('WGS84'); 4 | 5 | function transformer(from, to, coords) { 6 | var transformedArray, out, keys; 7 | if (Array.isArray(coords)) { 8 | transformedArray = transform(from, to, coords); 9 | if (coords.length === 3) { 10 | return [transformedArray.x, transformedArray.y, transformedArray.z]; 11 | } 12 | else { 13 | return [transformedArray.x, transformedArray.y]; 14 | } 15 | } 16 | else { 17 | out = transform(from, to, coords); 18 | keys = Object.keys(coords); 19 | if (keys.length === 2) { 20 | return out; 21 | } 22 | keys.forEach(function (key) { 23 | if (key === 'x' || key === 'y') { 24 | return; 25 | } 26 | out[key] = coords[key]; 27 | }); 28 | return out; 29 | } 30 | } 31 | 32 | function checkProj(item) { 33 | if (item instanceof proj) { 34 | return item; 35 | } 36 | if (item.oProj) { 37 | return item.oProj; 38 | } 39 | return proj(item); 40 | } 41 | function proj4(fromProj, toProj, coord) { 42 | fromProj = checkProj(fromProj); 43 | var single = false; 44 | var obj; 45 | if (typeof toProj === 'undefined') { 46 | toProj = fromProj; 47 | fromProj = wgs84; 48 | single = true; 49 | } 50 | else if (typeof toProj.x !== 'undefined' || Array.isArray(toProj)) { 51 | coord = toProj; 52 | toProj = fromProj; 53 | fromProj = wgs84; 54 | single = true; 55 | } 56 | toProj = checkProj(toProj); 57 | if (coord) { 58 | return transformer(fromProj, toProj, coord); 59 | } 60 | else { 61 | obj = { 62 | forward: function(coords) { 63 | return transformer(fromProj, toProj, coords); 64 | }, 65 | inverse: function(coords) { 66 | return transformer(toProj, fromProj, coords); 67 | } 68 | }; 69 | if (single) { 70 | obj.oProj = toProj; 71 | } 72 | return obj; 73 | } 74 | } 75 | export default proj4; 76 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/datum.js: -------------------------------------------------------------------------------- 1 | import {PJD_3PARAM, PJD_7PARAM, PJD_WGS84, PJD_NODATUM, SEC_TO_RAD} from './constants/values'; 2 | 3 | function datum(datumCode, datum_params, a, b, es, ep2) { 4 | var out = {}; 5 | 6 | if (datumCode === undefined || datumCode === 'none') { 7 | out.datum_type = PJD_NODATUM; 8 | } else { 9 | out.datum_type = PJD_WGS84; 10 | } 11 | 12 | if (datum_params) { 13 | out.datum_params = datum_params.map(parseFloat); 14 | if (out.datum_params[0] !== 0 || out.datum_params[1] !== 0 || out.datum_params[2] !== 0) { 15 | out.datum_type = PJD_3PARAM; 16 | } 17 | if (out.datum_params.length > 3) { 18 | if (out.datum_params[3] !== 0 || out.datum_params[4] !== 0 || out.datum_params[5] !== 0 || out.datum_params[6] !== 0) { 19 | out.datum_type = PJD_7PARAM; 20 | out.datum_params[3] *= SEC_TO_RAD; 21 | out.datum_params[4] *= SEC_TO_RAD; 22 | out.datum_params[5] *= SEC_TO_RAD; 23 | out.datum_params[6] = (out.datum_params[6] / 1000000.0) + 1.0; 24 | } 25 | } 26 | } 27 | 28 | out.a = a; //datum object also uses these values 29 | out.b = b; 30 | out.es = es; 31 | out.ep2 = ep2; 32 | return out; 33 | } 34 | 35 | export default datum; 36 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/datum_transform.js: -------------------------------------------------------------------------------- 1 | import {PJD_3PARAM, PJD_7PARAM, PJD_NODATUM} from './constants/values'; 2 | 3 | import {geodeticToGeocentric, geocentricToGeodetic, geocentricToWgs84, geocentricFromWgs84, compareDatums} from './datumUtils'; 4 | function checkParams(type) { 5 | return (type === PJD_3PARAM || type === PJD_7PARAM); 6 | } 7 | 8 | export default function(source, dest, point) { 9 | // Short cut if the datums are identical. 10 | if (compareDatums(source, dest)) { 11 | return point; // in this case, zero is sucess, 12 | // whereas cs_compare_datums returns 1 to indicate TRUE 13 | // confusing, should fix this 14 | } 15 | 16 | // Explicitly skip datum transform by setting 'datum=none' as parameter for either source or dest 17 | if (source.datum_type === PJD_NODATUM || dest.datum_type === PJD_NODATUM) { 18 | return point; 19 | } 20 | 21 | // If this datum requires grid shifts, then apply it to geodetic coordinates. 22 | 23 | // Do we need to go through geocentric coordinates? 24 | if (source.es === dest.es && source.a === dest.a && !checkParams(source.datum_type) && !checkParams(dest.datum_type)) { 25 | return point; 26 | } 27 | 28 | // Convert to geocentric coordinates. 29 | point = geodeticToGeocentric(point, source.es, source.a); 30 | // Convert between datums 31 | if (checkParams(source.datum_type)) { 32 | point = geocentricToWgs84(point, source.datum_type, source.datum_params); 33 | } 34 | if (checkParams(dest.datum_type)) { 35 | point = geocentricFromWgs84(point, dest.datum_type, dest.datum_params); 36 | } 37 | return geocentricToGeodetic(point, dest.es, dest.a, dest.b); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/defs.js: -------------------------------------------------------------------------------- 1 | import globals from './global'; 2 | import parseProj from './projString'; 3 | import wkt from 'wkt-parser'; 4 | 5 | function defs(name) { 6 | /*global console*/ 7 | var that = this; 8 | if (arguments.length === 2) { 9 | var def = arguments[1]; 10 | if (typeof def === 'string') { 11 | if (def.charAt(0) === '+') { 12 | defs[name] = parseProj(arguments[1]); 13 | } 14 | else { 15 | defs[name] = wkt(arguments[1]); 16 | } 17 | } else { 18 | defs[name] = def; 19 | } 20 | } 21 | else if (arguments.length === 1) { 22 | if (Array.isArray(name)) { 23 | return name.map(function(v) { 24 | if (Array.isArray(v)) { 25 | defs.apply(that, v); 26 | } 27 | else { 28 | defs(v); 29 | } 30 | }); 31 | } 32 | else if (typeof name === 'string') { 33 | if (name in defs) { 34 | return defs[name]; 35 | } 36 | } 37 | else if ('EPSG' in name) { 38 | defs['EPSG:' + name.EPSG] = name; 39 | } 40 | else if ('ESRI' in name) { 41 | defs['ESRI:' + name.ESRI] = name; 42 | } 43 | else if ('IAU2000' in name) { 44 | defs['IAU2000:' + name.IAU2000] = name; 45 | } 46 | else { 47 | console.log(name); 48 | } 49 | return; 50 | } 51 | 52 | 53 | } 54 | globals(defs); 55 | export default defs; 56 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/deriveConstants.js: -------------------------------------------------------------------------------- 1 | import {SIXTH, RA4, RA6, EPSLN} from './constants/values'; 2 | import {default as Ellipsoid, WGS84} from './constants/Ellipsoid'; 3 | import match from './match'; 4 | 5 | export function eccentricity(a, b, rf, R_A) { 6 | var a2 = a * a; // used in geocentric 7 | var b2 = b * b; // used in geocentric 8 | var es = (a2 - b2) / a2; // e ^ 2 9 | var e = 0; 10 | if (R_A) { 11 | a *= 1 - es * (SIXTH + es * (RA4 + es * RA6)); 12 | a2 = a * a; 13 | es = 0; 14 | } else { 15 | e = Math.sqrt(es); // eccentricity 16 | } 17 | var ep2 = (a2 - b2) / b2; // used in geocentric 18 | return { 19 | es: es, 20 | e: e, 21 | ep2: ep2 22 | }; 23 | } 24 | export function sphere(a, b, rf, ellps, sphere) { 25 | if (!a) { // do we have an ellipsoid? 26 | var ellipse = match(Ellipsoid, ellps); 27 | if (!ellipse) { 28 | ellipse = WGS84; 29 | } 30 | a = ellipse.a; 31 | b = ellipse.b; 32 | rf = ellipse.rf; 33 | } 34 | 35 | if (rf && !b) { 36 | b = (1.0 - 1.0 / rf) * a; 37 | } 38 | if (rf === 0 || Math.abs(a - b) < EPSLN) { 39 | sphere = true; 40 | b = a; 41 | } 42 | return { 43 | a: a, 44 | b: b, 45 | rf: rf, 46 | sphere: sphere 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/extend.js: -------------------------------------------------------------------------------- 1 | export default function(destination, source) { 2 | destination = destination || {}; 3 | var value, property; 4 | if (!source) { 5 | return destination; 6 | } 7 | for (property in source) { 8 | value = source[property]; 9 | if (value !== undefined) { 10 | destination[property] = value; 11 | } 12 | } 13 | return destination; 14 | } 15 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/global.js: -------------------------------------------------------------------------------- 1 | export default function(defs) { 2 | defs('EPSG:4326', "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"); 3 | defs('EPSG:4269', "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"); 4 | defs('EPSG:3857', "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"); 5 | 6 | defs.WGS84 = defs['EPSG:4326']; 7 | defs['EPSG:3785'] = defs['EPSG:3857']; // maintain backward compat, official code is 3857 8 | defs.GOOGLE = defs['EPSG:3857']; 9 | defs['EPSG:900913'] = defs['EPSG:3857']; 10 | defs['EPSG:102113'] = defs['EPSG:3857']; 11 | } 12 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/includedProjections.js: -------------------------------------------------------------------------------- 1 | import tmerc from "./projections/tmerc"; 2 | import utm from "./projections/utm"; 3 | import sterea from "./projections/sterea"; 4 | import stere from "./projections/stere"; 5 | import somerc from "./projections/somerc"; 6 | import omerc from "./projections/omerc"; 7 | import lcc from "./projections/lcc"; 8 | import krovak from "./projections/krovak"; 9 | import cass from "./projections/cass"; 10 | import laea from "./projections/laea"; 11 | import aea from "./projections/aea"; 12 | import gnom from "./projections/gnom"; 13 | import cea from "./projections/cea"; 14 | import eqc from "./projections/eqc"; 15 | import poly from "./projections/poly"; 16 | import nzmg from "./projections/nzmg"; 17 | import mill from "./projections/mill"; 18 | import sinu from "./projections/sinu"; 19 | import moll from "./projections/moll"; 20 | import eqdc from "./projections/eqdc"; 21 | import vandg from "./projections/vandg"; 22 | import aegd from "./projections/aeqd"; 23 | import etmerc from './projections/etmerc'; 24 | import qsc from './projections/qsc'; 25 | 26 | var projs = [ 27 | tmerc, 28 | utm, 29 | sterea, 30 | stere, 31 | somerc, 32 | omerc, 33 | lcc, 34 | krovak, 35 | cass, 36 | laea, 37 | aea, 38 | gnom, 39 | cea, 40 | eqc, 41 | poly, 42 | nzmg, 43 | mill, 44 | sinu, 45 | moll, 46 | eqdc, 47 | vandg, 48 | aegd, 49 | etmerc, 50 | qsc 51 | ]; 52 | 53 | export default function(proj4){ 54 | projs.forEach(function(proj){ 55 | proj4.Proj.projections.add(proj); 56 | }); 57 | } 58 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/index.js: -------------------------------------------------------------------------------- 1 | import proj4 from './core'; 2 | import Proj from "./Proj"; 3 | import Point from "./Point"; 4 | import common from "./common/toPoint"; 5 | import defs from "./defs"; 6 | import transform from "./transform"; 7 | import mgrs from "mgrs"; 8 | import version from "./version"; 9 | import includedProjections from "../projs"; 10 | 11 | proj4.defaultDatum = 'WGS84'; //default datum 12 | proj4.Proj = Proj; 13 | proj4.WGS84 = new proj4.Proj('WGS84'); 14 | proj4.Point = Point; 15 | proj4.toPoint = common; 16 | proj4.defs = defs; 17 | proj4.transform = transform; 18 | proj4.mgrs = mgrs; 19 | proj4.version = version; 20 | includedProjections(proj4); 21 | export default proj4; 22 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/match.js: -------------------------------------------------------------------------------- 1 | var ignoredChar = /[\s_\-\/\(\)]/g; 2 | export default function match(obj, key) { 3 | if (obj[key]) { 4 | return obj[key]; 5 | } 6 | var keys = Object.keys(obj); 7 | var lkey = key.toLowerCase().replace(ignoredChar, ''); 8 | var i = -1; 9 | var testkey, processedKey; 10 | while (++i < keys.length) { 11 | testkey = keys[i]; 12 | processedKey = testkey.toLowerCase().replace(ignoredChar, ''); 13 | if (processedKey === lkey) { 14 | return obj[testkey]; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/parseCode.js: -------------------------------------------------------------------------------- 1 | import defs from './defs'; 2 | import wkt from 'wkt-parser'; 3 | import projStr from './projString'; 4 | function testObj(code){ 5 | return typeof code === 'string'; 6 | } 7 | function testDef(code){ 8 | return code in defs; 9 | } 10 | var codeWords = ['PROJECTEDCRS', 'PROJCRS', 'GEOGCS','GEOCCS','PROJCS','LOCAL_CS', 'GEODCRS', 'GEODETICCRS', 'GEODETICDATUM', 'ENGCRS', 'ENGINEERINGCRS']; 11 | function testWKT(code){ 12 | return codeWords.some(function (word) { 13 | return code.indexOf(word) > -1; 14 | }); 15 | } 16 | function testProj(code){ 17 | return code[0] === '+'; 18 | } 19 | function parse(code){ 20 | if (testObj(code)) { 21 | //check to see if this is a WKT string 22 | if (testDef(code)) { 23 | return defs[code]; 24 | } 25 | if (testWKT(code)) { 26 | return wkt(code); 27 | } 28 | if (testProj(code)) { 29 | return projStr(code); 30 | } 31 | }else{ 32 | return code; 33 | } 34 | } 35 | 36 | export default parse; 37 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projString.js: -------------------------------------------------------------------------------- 1 | import {D2R} from './constants/values'; 2 | import PrimeMeridian from './constants/PrimeMeridian'; 3 | import units from './constants/units'; 4 | import match from './match'; 5 | 6 | export default function(defData) { 7 | var self = {}; 8 | var paramObj = defData.split('+').map(function(v) { 9 | return v.trim(); 10 | }).filter(function(a) { 11 | return a; 12 | }).reduce(function(p, a) { 13 | var split = a.split('='); 14 | split.push(true); 15 | p[split[0].toLowerCase()] = split[1]; 16 | return p; 17 | }, {}); 18 | var paramName, paramVal, paramOutname; 19 | var params = { 20 | proj: 'projName', 21 | datum: 'datumCode', 22 | rf: function(v) { 23 | self.rf = parseFloat(v); 24 | }, 25 | lat_0: function(v) { 26 | self.lat0 = v * D2R; 27 | }, 28 | lat_1: function(v) { 29 | self.lat1 = v * D2R; 30 | }, 31 | lat_2: function(v) { 32 | self.lat2 = v * D2R; 33 | }, 34 | lat_ts: function(v) { 35 | self.lat_ts = v * D2R; 36 | }, 37 | lon_0: function(v) { 38 | self.long0 = v * D2R; 39 | }, 40 | lon_1: function(v) { 41 | self.long1 = v * D2R; 42 | }, 43 | lon_2: function(v) { 44 | self.long2 = v * D2R; 45 | }, 46 | alpha: function(v) { 47 | self.alpha = parseFloat(v) * D2R; 48 | }, 49 | lonc: function(v) { 50 | self.longc = v * D2R; 51 | }, 52 | x_0: function(v) { 53 | self.x0 = parseFloat(v); 54 | }, 55 | y_0: function(v) { 56 | self.y0 = parseFloat(v); 57 | }, 58 | k_0: function(v) { 59 | self.k0 = parseFloat(v); 60 | }, 61 | k: function(v) { 62 | self.k0 = parseFloat(v); 63 | }, 64 | a: function(v) { 65 | self.a = parseFloat(v); 66 | }, 67 | b: function(v) { 68 | self.b = parseFloat(v); 69 | }, 70 | r_a: function() { 71 | self.R_A = true; 72 | }, 73 | zone: function(v) { 74 | self.zone = parseInt(v, 10); 75 | }, 76 | south: function() { 77 | self.utmSouth = true; 78 | }, 79 | towgs84: function(v) { 80 | self.datum_params = v.split(",").map(function(a) { 81 | return parseFloat(a); 82 | }); 83 | }, 84 | to_meter: function(v) { 85 | self.to_meter = parseFloat(v); 86 | }, 87 | units: function(v) { 88 | self.units = v; 89 | var unit = match(units, v); 90 | if (unit) { 91 | self.to_meter = unit.to_meter; 92 | } 93 | }, 94 | from_greenwich: function(v) { 95 | self.from_greenwich = v * D2R; 96 | }, 97 | pm: function(v) { 98 | var pm = match(PrimeMeridian, v); 99 | self.from_greenwich = (pm ? pm : parseFloat(v)) * D2R; 100 | }, 101 | nadgrids: function(v) { 102 | if (v === '@null') { 103 | self.datumCode = 'none'; 104 | } 105 | else { 106 | self.nadgrids = v; 107 | } 108 | }, 109 | axis: function(v) { 110 | var legalAxis = "ewnsud"; 111 | if (v.length === 3 && legalAxis.indexOf(v.substr(0, 1)) !== -1 && legalAxis.indexOf(v.substr(1, 1)) !== -1 && legalAxis.indexOf(v.substr(2, 1)) !== -1) { 112 | self.axis = v; 113 | } 114 | } 115 | }; 116 | for (paramName in paramObj) { 117 | paramVal = paramObj[paramName]; 118 | if (paramName in params) { 119 | paramOutname = params[paramName]; 120 | if (typeof paramOutname === 'function') { 121 | paramOutname(paramVal); 122 | } 123 | else { 124 | self[paramOutname] = paramVal; 125 | } 126 | } 127 | else { 128 | self[paramName] = paramVal; 129 | } 130 | } 131 | if(typeof self.datumCode === 'string' && self.datumCode !== "WGS84"){ 132 | self.datumCode = self.datumCode.toLowerCase(); 133 | } 134 | return self; 135 | } 136 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections.js: -------------------------------------------------------------------------------- 1 | import merc from "./projections/merc"; 2 | import longlat from "./projections/longlat"; 3 | var projs = [merc, longlat]; 4 | var names = {}; 5 | var projStore = []; 6 | 7 | function add(proj, i) { 8 | var len = projStore.length; 9 | if (!proj.names) { 10 | console.log(i); 11 | return true; 12 | } 13 | projStore[len] = proj; 14 | proj.names.forEach(function(n) { 15 | names[n.toLowerCase()] = len; 16 | }); 17 | return this; 18 | } 19 | 20 | export {add}; 21 | 22 | export function get(name) { 23 | if (!name) { 24 | return false; 25 | } 26 | var n = name.toLowerCase(); 27 | if (typeof names[n] !== 'undefined' && projStore[names[n]]) { 28 | return projStore[names[n]]; 29 | } 30 | } 31 | 32 | export function start() { 33 | projs.forEach(add); 34 | } 35 | export default { 36 | start: start, 37 | add: add, 38 | get: get 39 | }; 40 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/aea.js: -------------------------------------------------------------------------------- 1 | import msfnz from '../common/msfnz'; 2 | import qsfnz from '../common/qsfnz'; 3 | import adjust_lon from '../common/adjust_lon'; 4 | import asinz from '../common/asinz'; 5 | import {EPSLN} from '../constants/values'; 6 | 7 | export function init() { 8 | 9 | if (Math.abs(this.lat1 + this.lat2) < EPSLN) { 10 | return; 11 | } 12 | this.temp = this.b / this.a; 13 | this.es = 1 - Math.pow(this.temp, 2); 14 | this.e3 = Math.sqrt(this.es); 15 | 16 | this.sin_po = Math.sin(this.lat1); 17 | this.cos_po = Math.cos(this.lat1); 18 | this.t1 = this.sin_po; 19 | this.con = this.sin_po; 20 | this.ms1 = msfnz(this.e3, this.sin_po, this.cos_po); 21 | this.qs1 = qsfnz(this.e3, this.sin_po, this.cos_po); 22 | 23 | this.sin_po = Math.sin(this.lat2); 24 | this.cos_po = Math.cos(this.lat2); 25 | this.t2 = this.sin_po; 26 | this.ms2 = msfnz(this.e3, this.sin_po, this.cos_po); 27 | this.qs2 = qsfnz(this.e3, this.sin_po, this.cos_po); 28 | 29 | this.sin_po = Math.sin(this.lat0); 30 | this.cos_po = Math.cos(this.lat0); 31 | this.t3 = this.sin_po; 32 | this.qs0 = qsfnz(this.e3, this.sin_po, this.cos_po); 33 | 34 | if (Math.abs(this.lat1 - this.lat2) > EPSLN) { 35 | this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1); 36 | } 37 | else { 38 | this.ns0 = this.con; 39 | } 40 | this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1; 41 | this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0; 42 | } 43 | 44 | /* Albers Conical Equal Area forward equations--mapping lat,long to x,y 45 | -------------------------------------------------------------------*/ 46 | export function forward(p) { 47 | 48 | var lon = p.x; 49 | var lat = p.y; 50 | 51 | this.sin_phi = Math.sin(lat); 52 | this.cos_phi = Math.cos(lat); 53 | 54 | var qs = qsfnz(this.e3, this.sin_phi, this.cos_phi); 55 | var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0; 56 | var theta = this.ns0 * adjust_lon(lon - this.long0); 57 | var x = rh1 * Math.sin(theta) + this.x0; 58 | var y = this.rh - rh1 * Math.cos(theta) + this.y0; 59 | 60 | p.x = x; 61 | p.y = y; 62 | return p; 63 | } 64 | 65 | export function inverse(p) { 66 | var rh1, qs, con, theta, lon, lat; 67 | 68 | p.x -= this.x0; 69 | p.y = this.rh - p.y + this.y0; 70 | if (this.ns0 >= 0) { 71 | rh1 = Math.sqrt(p.x * p.x + p.y * p.y); 72 | con = 1; 73 | } 74 | else { 75 | rh1 = -Math.sqrt(p.x * p.x + p.y * p.y); 76 | con = -1; 77 | } 78 | theta = 0; 79 | if (rh1 !== 0) { 80 | theta = Math.atan2(con * p.x, con * p.y); 81 | } 82 | con = rh1 * this.ns0 / this.a; 83 | if (this.sphere) { 84 | lat = Math.asin((this.c - con * con) / (2 * this.ns0)); 85 | } 86 | else { 87 | qs = (this.c - con * con) / this.ns0; 88 | lat = this.phi1z(this.e3, qs); 89 | } 90 | 91 | lon = adjust_lon(theta / this.ns0 + this.long0); 92 | p.x = lon; 93 | p.y = lat; 94 | return p; 95 | } 96 | 97 | /* Function to compute phi1, the latitude for the inverse of the 98 | Albers Conical Equal-Area projection. 99 | -------------------------------------------*/ 100 | export function phi1z(eccent, qs) { 101 | var sinphi, cosphi, con, com, dphi; 102 | var phi = asinz(0.5 * qs); 103 | if (eccent < EPSLN) { 104 | return phi; 105 | } 106 | 107 | var eccnts = eccent * eccent; 108 | for (var i = 1; i <= 25; i++) { 109 | sinphi = Math.sin(phi); 110 | cosphi = Math.cos(phi); 111 | con = eccent * sinphi; 112 | com = 1 - con * con; 113 | dphi = 0.5 * com * com / cosphi * (qs / (1 - eccnts) - sinphi / com + 0.5 / eccent * Math.log((1 - con) / (1 + con))); 114 | phi = phi + dphi; 115 | if (Math.abs(dphi) <= 1e-7) { 116 | return phi; 117 | } 118 | } 119 | return null; 120 | } 121 | 122 | export var names = ["Albers_Conic_Equal_Area", "Albers", "aea"]; 123 | export default { 124 | init: init, 125 | forward: forward, 126 | inverse: inverse, 127 | names: names, 128 | phi1z: phi1z 129 | }; 130 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/cass.js: -------------------------------------------------------------------------------- 1 | import mlfn from '../common/mlfn'; 2 | import e0fn from '../common/e0fn'; 3 | import e1fn from '../common/e1fn'; 4 | import e2fn from '../common/e2fn'; 5 | import e3fn from '../common/e3fn'; 6 | import gN from '../common/gN'; 7 | import adjust_lon from '../common/adjust_lon'; 8 | import adjust_lat from '../common/adjust_lat'; 9 | import imlfn from '../common/imlfn'; 10 | import {HALF_PI, EPSLN} from '../constants/values'; 11 | 12 | export function init() { 13 | if (!this.sphere) { 14 | this.e0 = e0fn(this.es); 15 | this.e1 = e1fn(this.es); 16 | this.e2 = e2fn(this.es); 17 | this.e3 = e3fn(this.es); 18 | this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0); 19 | } 20 | } 21 | 22 | /* Cassini forward equations--mapping lat,long to x,y 23 | -----------------------------------------------------------------------*/ 24 | export function forward(p) { 25 | 26 | /* Forward equations 27 | -----------------*/ 28 | var x, y; 29 | var lam = p.x; 30 | var phi = p.y; 31 | lam = adjust_lon(lam - this.long0); 32 | 33 | if (this.sphere) { 34 | x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam)); 35 | y = this.a * (Math.atan2(Math.tan(phi), Math.cos(lam)) - this.lat0); 36 | } 37 | else { 38 | //ellipsoid 39 | var sinphi = Math.sin(phi); 40 | var cosphi = Math.cos(phi); 41 | var nl = gN(this.a, this.e, sinphi); 42 | var tl = Math.tan(phi) * Math.tan(phi); 43 | var al = lam * Math.cos(phi); 44 | var asq = al * al; 45 | var cl = this.es * cosphi * cosphi / (1 - this.es); 46 | var ml = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi); 47 | 48 | x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120)); 49 | y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24); 50 | 51 | 52 | } 53 | 54 | p.x = x + this.x0; 55 | p.y = y + this.y0; 56 | return p; 57 | } 58 | 59 | /* Inverse equations 60 | -----------------*/ 61 | export function inverse(p) { 62 | p.x -= this.x0; 63 | p.y -= this.y0; 64 | var x = p.x / this.a; 65 | var y = p.y / this.a; 66 | var phi, lam; 67 | 68 | if (this.sphere) { 69 | var dd = y + this.lat0; 70 | phi = Math.asin(Math.sin(dd) * Math.cos(x)); 71 | lam = Math.atan2(Math.tan(x), Math.cos(dd)); 72 | } 73 | else { 74 | /* ellipsoid */ 75 | var ml1 = this.ml0 / this.a + y; 76 | var phi1 = imlfn(ml1, this.e0, this.e1, this.e2, this.e3); 77 | if (Math.abs(Math.abs(phi1) - HALF_PI) <= EPSLN) { 78 | p.x = this.long0; 79 | p.y = HALF_PI; 80 | if (y < 0) { 81 | p.y *= -1; 82 | } 83 | return p; 84 | } 85 | var nl1 = gN(this.a, this.e, Math.sin(phi1)); 86 | 87 | var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es); 88 | var tl1 = Math.pow(Math.tan(phi1), 2); 89 | var dl = x * this.a / nl1; 90 | var dsq = dl * dl; 91 | phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24); 92 | lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1); 93 | 94 | } 95 | 96 | p.x = adjust_lon(lam + this.long0); 97 | p.y = adjust_lat(phi); 98 | return p; 99 | 100 | } 101 | 102 | export var names = ["Cassini", "Cassini_Soldner", "cass"]; 103 | export default { 104 | init: init, 105 | forward: forward, 106 | inverse: inverse, 107 | names: names 108 | }; 109 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/cea.js: -------------------------------------------------------------------------------- 1 | import adjust_lon from '../common/adjust_lon'; 2 | import qsfnz from '../common/qsfnz'; 3 | import msfnz from '../common/msfnz'; 4 | import iqsfnz from '../common/iqsfnz'; 5 | 6 | /* 7 | reference: 8 | "Cartographic Projection Procedures for the UNIX Environment- 9 | A User's Manual" by Gerald I. Evenden, 10 | USGS Open File Report 90-284and Release 4 Interim Reports (2003) 11 | */ 12 | export function init() { 13 | //no-op 14 | if (!this.sphere) { 15 | this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)); 16 | } 17 | } 18 | 19 | /* Cylindrical Equal Area forward equations--mapping lat,long to x,y 20 | ------------------------------------------------------------*/ 21 | export function forward(p) { 22 | var lon = p.x; 23 | var lat = p.y; 24 | var x, y; 25 | /* Forward equations 26 | -----------------*/ 27 | var dlon = adjust_lon(lon - this.long0); 28 | if (this.sphere) { 29 | x = this.x0 + this.a * dlon * Math.cos(this.lat_ts); 30 | y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts); 31 | } 32 | else { 33 | var qs = qsfnz(this.e, Math.sin(lat)); 34 | x = this.x0 + this.a * this.k0 * dlon; 35 | y = this.y0 + this.a * qs * 0.5 / this.k0; 36 | } 37 | 38 | p.x = x; 39 | p.y = y; 40 | return p; 41 | } 42 | 43 | /* Cylindrical Equal Area inverse equations--mapping x,y to lat/long 44 | ------------------------------------------------------------*/ 45 | export function inverse(p) { 46 | p.x -= this.x0; 47 | p.y -= this.y0; 48 | var lon, lat; 49 | 50 | if (this.sphere) { 51 | lon = adjust_lon(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts)); 52 | lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts)); 53 | } 54 | else { 55 | lat = iqsfnz(this.e, 2 * p.y * this.k0 / this.a); 56 | lon = adjust_lon(this.long0 + p.x / (this.a * this.k0)); 57 | } 58 | 59 | p.x = lon; 60 | p.y = lat; 61 | return p; 62 | } 63 | 64 | export var names = ["cea"]; 65 | export default { 66 | init: init, 67 | forward: forward, 68 | inverse: inverse, 69 | names: names 70 | }; 71 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/eqc.js: -------------------------------------------------------------------------------- 1 | import adjust_lon from '../common/adjust_lon'; 2 | import adjust_lat from '../common/adjust_lat'; 3 | 4 | export function init() { 5 | 6 | this.x0 = this.x0 || 0; 7 | this.y0 = this.y0 || 0; 8 | this.lat0 = this.lat0 || 0; 9 | this.long0 = this.long0 || 0; 10 | this.lat_ts = this.lat_ts || 0; 11 | this.title = this.title || "Equidistant Cylindrical (Plate Carre)"; 12 | 13 | this.rc = Math.cos(this.lat_ts); 14 | } 15 | 16 | // forward equations--mapping lat,long to x,y 17 | // ----------------------------------------------------------------- 18 | export function forward(p) { 19 | 20 | var lon = p.x; 21 | var lat = p.y; 22 | 23 | var dlon = adjust_lon(lon - this.long0); 24 | var dlat = adjust_lat(lat - this.lat0); 25 | p.x = this.x0 + (this.a * dlon * this.rc); 26 | p.y = this.y0 + (this.a * dlat); 27 | return p; 28 | } 29 | 30 | // inverse equations--mapping x,y to lat/long 31 | // ----------------------------------------------------------------- 32 | export function inverse(p) { 33 | 34 | var x = p.x; 35 | var y = p.y; 36 | 37 | p.x = adjust_lon(this.long0 + ((x - this.x0) / (this.a * this.rc))); 38 | p.y = adjust_lat(this.lat0 + ((y - this.y0) / (this.a))); 39 | return p; 40 | } 41 | 42 | export var names = ["Equirectangular", "Equidistant_Cylindrical", "eqc"]; 43 | export default { 44 | init: init, 45 | forward: forward, 46 | inverse: inverse, 47 | names: names 48 | }; 49 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/eqdc.js: -------------------------------------------------------------------------------- 1 | import e0fn from '../common/e0fn'; 2 | import e1fn from '../common/e1fn'; 3 | import e2fn from '../common/e2fn'; 4 | import e3fn from '../common/e3fn'; 5 | import msfnz from '../common/msfnz'; 6 | import mlfn from '../common/mlfn'; 7 | import adjust_lon from '../common/adjust_lon'; 8 | import adjust_lat from '../common/adjust_lat'; 9 | import imlfn from '../common/imlfn'; 10 | import {EPSLN} from '../constants/values'; 11 | 12 | export function init() { 13 | 14 | /* Place parameters in static storage for common use 15 | -------------------------------------------------*/ 16 | // Standard Parallels cannot be equal and on opposite sides of the equator 17 | if (Math.abs(this.lat1 + this.lat2) < EPSLN) { 18 | return; 19 | } 20 | this.lat2 = this.lat2 || this.lat1; 21 | this.temp = this.b / this.a; 22 | this.es = 1 - Math.pow(this.temp, 2); 23 | this.e = Math.sqrt(this.es); 24 | this.e0 = e0fn(this.es); 25 | this.e1 = e1fn(this.es); 26 | this.e2 = e2fn(this.es); 27 | this.e3 = e3fn(this.es); 28 | 29 | this.sinphi = Math.sin(this.lat1); 30 | this.cosphi = Math.cos(this.lat1); 31 | 32 | this.ms1 = msfnz(this.e, this.sinphi, this.cosphi); 33 | this.ml1 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat1); 34 | 35 | if (Math.abs(this.lat1 - this.lat2) < EPSLN) { 36 | this.ns = this.sinphi; 37 | } 38 | else { 39 | this.sinphi = Math.sin(this.lat2); 40 | this.cosphi = Math.cos(this.lat2); 41 | this.ms2 = msfnz(this.e, this.sinphi, this.cosphi); 42 | this.ml2 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat2); 43 | this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1); 44 | } 45 | this.g = this.ml1 + this.ms1 / this.ns; 46 | this.ml0 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0); 47 | this.rh = this.a * (this.g - this.ml0); 48 | } 49 | 50 | /* Equidistant Conic forward equations--mapping lat,long to x,y 51 | -----------------------------------------------------------*/ 52 | export function forward(p) { 53 | var lon = p.x; 54 | var lat = p.y; 55 | var rh1; 56 | 57 | /* Forward equations 58 | -----------------*/ 59 | if (this.sphere) { 60 | rh1 = this.a * (this.g - lat); 61 | } 62 | else { 63 | var ml = mlfn(this.e0, this.e1, this.e2, this.e3, lat); 64 | rh1 = this.a * (this.g - ml); 65 | } 66 | var theta = this.ns * adjust_lon(lon - this.long0); 67 | var x = this.x0 + rh1 * Math.sin(theta); 68 | var y = this.y0 + this.rh - rh1 * Math.cos(theta); 69 | p.x = x; 70 | p.y = y; 71 | return p; 72 | } 73 | 74 | /* Inverse equations 75 | -----------------*/ 76 | export function inverse(p) { 77 | p.x -= this.x0; 78 | p.y = this.rh - p.y + this.y0; 79 | var con, rh1, lat, lon; 80 | if (this.ns >= 0) { 81 | rh1 = Math.sqrt(p.x * p.x + p.y * p.y); 82 | con = 1; 83 | } 84 | else { 85 | rh1 = -Math.sqrt(p.x * p.x + p.y * p.y); 86 | con = -1; 87 | } 88 | var theta = 0; 89 | if (rh1 !== 0) { 90 | theta = Math.atan2(con * p.x, con * p.y); 91 | } 92 | 93 | if (this.sphere) { 94 | lon = adjust_lon(this.long0 + theta / this.ns); 95 | lat = adjust_lat(this.g - rh1 / this.a); 96 | p.x = lon; 97 | p.y = lat; 98 | return p; 99 | } 100 | else { 101 | var ml = this.g - rh1 / this.a; 102 | lat = imlfn(ml, this.e0, this.e1, this.e2, this.e3); 103 | lon = adjust_lon(this.long0 + theta / this.ns); 104 | p.x = lon; 105 | p.y = lat; 106 | return p; 107 | } 108 | 109 | } 110 | 111 | export var names = ["Equidistant_Conic", "eqdc"]; 112 | export default { 113 | init: init, 114 | forward: forward, 115 | inverse: inverse, 116 | names: names 117 | }; 118 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/equi.js: -------------------------------------------------------------------------------- 1 | import adjust_lon from '../common/adjust_lon'; 2 | 3 | export function init() { 4 | this.x0 = this.x0 || 0; 5 | this.y0 = this.y0 || 0; 6 | this.lat0 = this.lat0 || 0; 7 | this.long0 = this.long0 || 0; 8 | ///this.t2; 9 | } 10 | 11 | /* Equirectangular forward equations--mapping lat,long to x,y 12 | ---------------------------------------------------------*/ 13 | export function forward(p) { 14 | 15 | var lon = p.x; 16 | var lat = p.y; 17 | 18 | var dlon = adjust_lon(lon - this.long0); 19 | var x = this.x0 + this.a * dlon * Math.cos(this.lat0); 20 | var y = this.y0 + this.a * lat; 21 | 22 | this.t1 = x; 23 | this.t2 = Math.cos(this.lat0); 24 | p.x = x; 25 | p.y = y; 26 | return p; 27 | } 28 | 29 | /* Equirectangular inverse equations--mapping x,y to lat/long 30 | ---------------------------------------------------------*/ 31 | export function inverse(p) { 32 | 33 | p.x -= this.x0; 34 | p.y -= this.y0; 35 | var lat = p.y / this.a; 36 | 37 | var lon = adjust_lon(this.long0 + p.x / (this.a * Math.cos(this.lat0))); 38 | p.x = lon; 39 | p.y = lat; 40 | } 41 | 42 | export var names = ["equi"]; 43 | export default { 44 | init: init, 45 | forward: forward, 46 | inverse: inverse, 47 | names: names 48 | }; 49 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/gauss.js: -------------------------------------------------------------------------------- 1 | import srat from '../common/srat'; 2 | var MAX_ITER = 20; 3 | import {HALF_PI, FORTPI} from '../constants/values'; 4 | 5 | export function init() { 6 | var sphi = Math.sin(this.lat0); 7 | var cphi = Math.cos(this.lat0); 8 | cphi *= cphi; 9 | this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi); 10 | this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es)); 11 | this.phic0 = Math.asin(sphi / this.C); 12 | this.ratexp = 0.5 * this.C * this.e; 13 | this.K = Math.tan(0.5 * this.phic0 + FORTPI) / (Math.pow(Math.tan(0.5 * this.lat0 + FORTPI), this.C) * srat(this.e * sphi, this.ratexp)); 14 | } 15 | 16 | export function forward(p) { 17 | var lon = p.x; 18 | var lat = p.y; 19 | 20 | p.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + FORTPI), this.C) * srat(this.e * Math.sin(lat), this.ratexp)) - HALF_PI; 21 | p.x = this.C * lon; 22 | return p; 23 | } 24 | 25 | export function inverse(p) { 26 | var DEL_TOL = 1e-14; 27 | var lon = p.x / this.C; 28 | var lat = p.y; 29 | var num = Math.pow(Math.tan(0.5 * lat + FORTPI) / this.K, 1 / this.C); 30 | for (var i = MAX_ITER; i > 0; --i) { 31 | lat = 2 * Math.atan(num * srat(this.e * Math.sin(p.y), - 0.5 * this.e)) - HALF_PI; 32 | if (Math.abs(lat - p.y) < DEL_TOL) { 33 | break; 34 | } 35 | p.y = lat; 36 | } 37 | /* convergence failed */ 38 | if (!i) { 39 | return null; 40 | } 41 | p.x = lon; 42 | p.y = lat; 43 | return p; 44 | } 45 | 46 | export var names = ["gauss"]; 47 | export default { 48 | init: init, 49 | forward: forward, 50 | inverse: inverse, 51 | names: names 52 | }; 53 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/gnom.js: -------------------------------------------------------------------------------- 1 | import adjust_lon from '../common/adjust_lon'; 2 | import asinz from '../common/asinz'; 3 | import {EPSLN} from '../constants/values'; 4 | 5 | /* 6 | reference: 7 | Wolfram Mathworld "Gnomonic Projection" 8 | http://mathworld.wolfram.com/GnomonicProjection.html 9 | Accessed: 12th November 2009 10 | */ 11 | export function init() { 12 | 13 | /* Place parameters in static storage for common use 14 | -------------------------------------------------*/ 15 | this.sin_p14 = Math.sin(this.lat0); 16 | this.cos_p14 = Math.cos(this.lat0); 17 | // Approximation for projecting points to the horizon (infinity) 18 | this.infinity_dist = 1000 * this.a; 19 | this.rc = 1; 20 | } 21 | 22 | /* Gnomonic forward equations--mapping lat,long to x,y 23 | ---------------------------------------------------*/ 24 | export function forward(p) { 25 | var sinphi, cosphi; /* sin and cos value */ 26 | var dlon; /* delta longitude value */ 27 | var coslon; /* cos of longitude */ 28 | var ksp; /* scale factor */ 29 | var g; 30 | var x, y; 31 | var lon = p.x; 32 | var lat = p.y; 33 | /* Forward equations 34 | -----------------*/ 35 | dlon = adjust_lon(lon - this.long0); 36 | 37 | sinphi = Math.sin(lat); 38 | cosphi = Math.cos(lat); 39 | 40 | coslon = Math.cos(dlon); 41 | g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon; 42 | ksp = 1; 43 | if ((g > 0) || (Math.abs(g) <= EPSLN)) { 44 | x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g; 45 | y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g; 46 | } 47 | else { 48 | 49 | // Point is in the opposing hemisphere and is unprojectable 50 | // We still need to return a reasonable point, so we project 51 | // to infinity, on a bearing 52 | // equivalent to the northern hemisphere equivalent 53 | // This is a reasonable approximation for short shapes and lines that 54 | // straddle the horizon. 55 | 56 | x = this.x0 + this.infinity_dist * cosphi * Math.sin(dlon); 57 | y = this.y0 + this.infinity_dist * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon); 58 | 59 | } 60 | p.x = x; 61 | p.y = y; 62 | return p; 63 | } 64 | 65 | export function inverse(p) { 66 | var rh; /* Rho */ 67 | var sinc, cosc; 68 | var c; 69 | var lon, lat; 70 | 71 | /* Inverse equations 72 | -----------------*/ 73 | p.x = (p.x - this.x0) / this.a; 74 | p.y = (p.y - this.y0) / this.a; 75 | 76 | p.x /= this.k0; 77 | p.y /= this.k0; 78 | 79 | if ((rh = Math.sqrt(p.x * p.x + p.y * p.y))) { 80 | c = Math.atan2(rh, this.rc); 81 | sinc = Math.sin(c); 82 | cosc = Math.cos(c); 83 | 84 | lat = asinz(cosc * this.sin_p14 + (p.y * sinc * this.cos_p14) / rh); 85 | lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc); 86 | lon = adjust_lon(this.long0 + lon); 87 | } 88 | else { 89 | lat = this.phic0; 90 | lon = 0; 91 | } 92 | 93 | p.x = lon; 94 | p.y = lat; 95 | return p; 96 | } 97 | 98 | export var names = ["gnom"]; 99 | export default { 100 | init: init, 101 | forward: forward, 102 | inverse: inverse, 103 | names: names 104 | }; 105 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/gstmerc.js: -------------------------------------------------------------------------------- 1 | import latiso from '../common/latiso'; 2 | import sinh from '../common/sinh'; 3 | import cosh from '../common/cosh'; 4 | import invlatiso from '../common/invlatiso'; 5 | 6 | export function init() { 7 | 8 | // array of: a, b, lon0, lat0, k0, x0, y0 9 | var temp = this.b / this.a; 10 | this.e = Math.sqrt(1 - temp * temp); 11 | this.lc = this.long0; 12 | this.rs = Math.sqrt(1 + this.e * this.e * Math.pow(Math.cos(this.lat0), 4) / (1 - this.e * this.e)); 13 | var sinz = Math.sin(this.lat0); 14 | var pc = Math.asin(sinz / this.rs); 15 | var sinzpc = Math.sin(pc); 16 | this.cp = latiso(0, pc, sinzpc) - this.rs * latiso(this.e, this.lat0, sinz); 17 | this.n2 = this.k0 * this.a * Math.sqrt(1 - this.e * this.e) / (1 - this.e * this.e * sinz * sinz); 18 | this.xs = this.x0; 19 | this.ys = this.y0 - this.n2 * pc; 20 | 21 | if (!this.title) { 22 | this.title = "Gauss Schreiber transverse mercator"; 23 | } 24 | } 25 | 26 | // forward equations--mapping lat,long to x,y 27 | // ----------------------------------------------------------------- 28 | export function forward(p) { 29 | 30 | var lon = p.x; 31 | var lat = p.y; 32 | 33 | var L = this.rs * (lon - this.lc); 34 | var Ls = this.cp + (this.rs * latiso(this.e, lat, Math.sin(lat))); 35 | var lat1 = Math.asin(Math.sin(L) / cosh(Ls)); 36 | var Ls1 = latiso(0, lat1, Math.sin(lat1)); 37 | p.x = this.xs + (this.n2 * Ls1); 38 | p.y = this.ys + (this.n2 * Math.atan(sinh(Ls) / Math.cos(L))); 39 | return p; 40 | } 41 | 42 | // inverse equations--mapping x,y to lat/long 43 | // ----------------------------------------------------------------- 44 | export function inverse(p) { 45 | 46 | var x = p.x; 47 | var y = p.y; 48 | 49 | var L = Math.atan(sinh((x - this.xs) / this.n2) / Math.cos((y - this.ys) / this.n2)); 50 | var lat1 = Math.asin(Math.sin((y - this.ys) / this.n2) / cosh((x - this.xs) / this.n2)); 51 | var LC = latiso(0, lat1, Math.sin(lat1)); 52 | p.x = this.lc + L / this.rs; 53 | p.y = invlatiso(this.e, (LC - this.cp) / this.rs); 54 | return p; 55 | } 56 | 57 | export var names = ["gstmerg"]; 58 | export default { 59 | init: init, 60 | forward: forward, 61 | inverse: inverse, 62 | names: names 63 | }; 64 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/krovak.js: -------------------------------------------------------------------------------- 1 | import adjust_lon from '../common/adjust_lon'; 2 | 3 | export function init() { 4 | this.a = 6377397.155; 5 | this.es = 0.006674372230614; 6 | this.e = Math.sqrt(this.es); 7 | if (!this.lat0) { 8 | this.lat0 = 0.863937979737193; 9 | } 10 | if (!this.long0) { 11 | this.long0 = 0.7417649320975901 - 0.308341501185665; 12 | } 13 | /* if scale not set default to 0.9999 */ 14 | if (!this.k0) { 15 | this.k0 = 0.9999; 16 | } 17 | this.s45 = 0.785398163397448; /* 45 */ 18 | this.s90 = 2 * this.s45; 19 | this.fi0 = this.lat0; 20 | this.e2 = this.es; 21 | this.e = Math.sqrt(this.e2); 22 | this.alfa = Math.sqrt(1 + (this.e2 * Math.pow(Math.cos(this.fi0), 4)) / (1 - this.e2)); 23 | this.uq = 1.04216856380474; 24 | this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa); 25 | this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2); 26 | this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g; 27 | this.k1 = this.k0; 28 | this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2)); 29 | this.s0 = 1.37008346281555; 30 | this.n = Math.sin(this.s0); 31 | this.ro0 = this.k1 * this.n0 / Math.tan(this.s0); 32 | this.ad = this.s90 - this.uq; 33 | } 34 | 35 | /* ellipsoid */ 36 | /* calculate xy from lat/lon */ 37 | /* Constants, identical to inverse transform function */ 38 | export function forward(p) { 39 | var gfi, u, deltav, s, d, eps, ro; 40 | var lon = p.x; 41 | var lat = p.y; 42 | var delta_lon = adjust_lon(lon - this.long0); 43 | /* Transformation */ 44 | gfi = Math.pow(((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat))), (this.alfa * this.e / 2)); 45 | u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45); 46 | deltav = -delta_lon * this.alfa; 47 | s = Math.asin(Math.cos(this.ad) * Math.sin(u) + Math.sin(this.ad) * Math.cos(u) * Math.cos(deltav)); 48 | d = Math.asin(Math.cos(u) * Math.sin(deltav) / Math.cos(s)); 49 | eps = this.n * d; 50 | ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n); 51 | p.y = ro * Math.cos(eps) / 1; 52 | p.x = ro * Math.sin(eps) / 1; 53 | 54 | if (!this.czech) { 55 | p.y *= -1; 56 | p.x *= -1; 57 | } 58 | return (p); 59 | } 60 | 61 | /* calculate lat/lon from xy */ 62 | export function inverse(p) { 63 | var u, deltav, s, d, eps, ro, fi1; 64 | var ok; 65 | 66 | /* Transformation */ 67 | /* revert y, x*/ 68 | var tmp = p.x; 69 | p.x = p.y; 70 | p.y = tmp; 71 | if (!this.czech) { 72 | p.y *= -1; 73 | p.x *= -1; 74 | } 75 | ro = Math.sqrt(p.x * p.x + p.y * p.y); 76 | eps = Math.atan2(p.y, p.x); 77 | d = eps / Math.sin(this.s0); 78 | s = 2 * (Math.atan(Math.pow(this.ro0 / ro, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45); 79 | u = Math.asin(Math.cos(this.ad) * Math.sin(s) - Math.sin(this.ad) * Math.cos(s) * Math.cos(d)); 80 | deltav = Math.asin(Math.cos(s) * Math.sin(d) / Math.cos(u)); 81 | p.x = this.long0 - deltav / this.alfa; 82 | fi1 = u; 83 | ok = 0; 84 | var iter = 0; 85 | do { 86 | p.y = 2 * (Math.atan(Math.pow(this.k, - 1 / this.alfa) * Math.pow(Math.tan(u / 2 + this.s45), 1 / this.alfa) * Math.pow((1 + this.e * Math.sin(fi1)) / (1 - this.e * Math.sin(fi1)), this.e / 2)) - this.s45); 87 | if (Math.abs(fi1 - p.y) < 0.0000000001) { 88 | ok = 1; 89 | } 90 | fi1 = p.y; 91 | iter += 1; 92 | } while (ok === 0 && iter < 15); 93 | if (iter >= 15) { 94 | return null; 95 | } 96 | 97 | return (p); 98 | } 99 | 100 | export var names = ["Krovak", "krovak"]; 101 | export default { 102 | init: init, 103 | forward: forward, 104 | inverse: inverse, 105 | names: names 106 | }; 107 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/lcc.js: -------------------------------------------------------------------------------- 1 | import msfnz from '../common/msfnz'; 2 | import tsfnz from '../common/tsfnz'; 3 | import sign from '../common/sign'; 4 | import adjust_lon from '../common/adjust_lon'; 5 | import phi2z from '../common/phi2z'; 6 | import {HALF_PI, EPSLN} from '../constants/values'; 7 | export function init() { 8 | 9 | // array of: r_maj,r_min,lat1,lat2,c_lon,c_lat,false_east,false_north 10 | //double c_lat; /* center latitude */ 11 | //double c_lon; /* center longitude */ 12 | //double lat1; /* first standard parallel */ 13 | //double lat2; /* second standard parallel */ 14 | //double r_maj; /* major axis */ 15 | //double r_min; /* minor axis */ 16 | //double false_east; /* x offset in meters */ 17 | //double false_north; /* y offset in meters */ 18 | 19 | if (!this.lat2) { 20 | this.lat2 = this.lat1; 21 | } //if lat2 is not defined 22 | if (!this.k0) { 23 | this.k0 = 1; 24 | } 25 | this.x0 = this.x0 || 0; 26 | this.y0 = this.y0 || 0; 27 | // Standard Parallels cannot be equal and on opposite sides of the equator 28 | if (Math.abs(this.lat1 + this.lat2) < EPSLN) { 29 | return; 30 | } 31 | 32 | var temp = this.b / this.a; 33 | this.e = Math.sqrt(1 - temp * temp); 34 | 35 | var sin1 = Math.sin(this.lat1); 36 | var cos1 = Math.cos(this.lat1); 37 | var ms1 = msfnz(this.e, sin1, cos1); 38 | var ts1 = tsfnz(this.e, this.lat1, sin1); 39 | 40 | var sin2 = Math.sin(this.lat2); 41 | var cos2 = Math.cos(this.lat2); 42 | var ms2 = msfnz(this.e, sin2, cos2); 43 | var ts2 = tsfnz(this.e, this.lat2, sin2); 44 | 45 | var ts0 = tsfnz(this.e, this.lat0, Math.sin(this.lat0)); 46 | 47 | if (Math.abs(this.lat1 - this.lat2) > EPSLN) { 48 | this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2); 49 | } 50 | else { 51 | this.ns = sin1; 52 | } 53 | if (isNaN(this.ns)) { 54 | this.ns = sin1; 55 | } 56 | this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns)); 57 | this.rh = this.a * this.f0 * Math.pow(ts0, this.ns); 58 | if (!this.title) { 59 | this.title = "Lambert Conformal Conic"; 60 | } 61 | } 62 | 63 | // Lambert Conformal conic forward equations--mapping lat,long to x,y 64 | // ----------------------------------------------------------------- 65 | export function forward(p) { 66 | 67 | var lon = p.x; 68 | var lat = p.y; 69 | 70 | // singular cases : 71 | if (Math.abs(2 * Math.abs(lat) - Math.PI) <= EPSLN) { 72 | lat = sign(lat) * (HALF_PI - 2 * EPSLN); 73 | } 74 | 75 | var con = Math.abs(Math.abs(lat) - HALF_PI); 76 | var ts, rh1; 77 | if (con > EPSLN) { 78 | ts = tsfnz(this.e, lat, Math.sin(lat)); 79 | rh1 = this.a * this.f0 * Math.pow(ts, this.ns); 80 | } 81 | else { 82 | con = lat * this.ns; 83 | if (con <= 0) { 84 | return null; 85 | } 86 | rh1 = 0; 87 | } 88 | var theta = this.ns * adjust_lon(lon - this.long0); 89 | p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0; 90 | p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0; 91 | 92 | return p; 93 | } 94 | 95 | // Lambert Conformal Conic inverse equations--mapping x,y to lat/long 96 | // ----------------------------------------------------------------- 97 | export function inverse(p) { 98 | 99 | var rh1, con, ts; 100 | var lat, lon; 101 | var x = (p.x - this.x0) / this.k0; 102 | var y = (this.rh - (p.y - this.y0) / this.k0); 103 | if (this.ns > 0) { 104 | rh1 = Math.sqrt(x * x + y * y); 105 | con = 1; 106 | } 107 | else { 108 | rh1 = -Math.sqrt(x * x + y * y); 109 | con = -1; 110 | } 111 | var theta = 0; 112 | if (rh1 !== 0) { 113 | theta = Math.atan2((con * x), (con * y)); 114 | } 115 | if ((rh1 !== 0) || (this.ns > 0)) { 116 | con = 1 / this.ns; 117 | ts = Math.pow((rh1 / (this.a * this.f0)), con); 118 | lat = phi2z(this.e, ts); 119 | if (lat === -9999) { 120 | return null; 121 | } 122 | } 123 | else { 124 | lat = -HALF_PI; 125 | } 126 | lon = adjust_lon(theta / this.ns + this.long0); 127 | 128 | p.x = lon; 129 | p.y = lat; 130 | return p; 131 | } 132 | 133 | export var names = ["Lambert Tangential Conformal Conic Projection", "Lambert_Conformal_Conic", "Lambert_Conformal_Conic_2SP", "lcc"]; 134 | export default { 135 | init: init, 136 | forward: forward, 137 | inverse: inverse, 138 | names: names 139 | }; 140 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/longlat.js: -------------------------------------------------------------------------------- 1 | export function init() { 2 | //no-op for longlat 3 | } 4 | 5 | function identity(pt) { 6 | return pt; 7 | } 8 | export {identity as forward}; 9 | export {identity as inverse}; 10 | export var names = ["longlat", "identity"]; 11 | export default { 12 | init: init, 13 | forward: identity, 14 | inverse: identity, 15 | names: names 16 | }; 17 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/merc.js: -------------------------------------------------------------------------------- 1 | import msfnz from '../common/msfnz'; 2 | 3 | import adjust_lon from '../common/adjust_lon'; 4 | import tsfnz from '../common/tsfnz'; 5 | import phi2z from '../common/phi2z'; 6 | import {FORTPI, R2D, EPSLN, HALF_PI} from '../constants/values'; 7 | export function init() { 8 | var con = this.b / this.a; 9 | this.es = 1 - con * con; 10 | if(!('x0' in this)){ 11 | this.x0 = 0; 12 | } 13 | if(!('y0' in this)){ 14 | this.y0 = 0; 15 | } 16 | this.e = Math.sqrt(this.es); 17 | if (this.lat_ts) { 18 | if (this.sphere) { 19 | this.k0 = Math.cos(this.lat_ts); 20 | } 21 | else { 22 | this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)); 23 | } 24 | } 25 | else { 26 | if (!this.k0) { 27 | if (this.k) { 28 | this.k0 = this.k; 29 | } 30 | else { 31 | this.k0 = 1; 32 | } 33 | } 34 | } 35 | } 36 | 37 | /* Mercator forward equations--mapping lat,long to x,y 38 | --------------------------------------------------*/ 39 | 40 | export function forward(p) { 41 | var lon = p.x; 42 | var lat = p.y; 43 | // convert to radians 44 | if (lat * R2D > 90 && lat * R2D < -90 && lon * R2D > 180 && lon * R2D < -180) { 45 | return null; 46 | } 47 | 48 | var x, y; 49 | if (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) { 50 | return null; 51 | } 52 | else { 53 | if (this.sphere) { 54 | x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0); 55 | y = this.y0 + this.a * this.k0 * Math.log(Math.tan(FORTPI + 0.5 * lat)); 56 | } 57 | else { 58 | var sinphi = Math.sin(lat); 59 | var ts = tsfnz(this.e, lat, sinphi); 60 | x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0); 61 | y = this.y0 - this.a * this.k0 * Math.log(ts); 62 | } 63 | p.x = x; 64 | p.y = y; 65 | return p; 66 | } 67 | } 68 | 69 | /* Mercator inverse equations--mapping x,y to lat/long 70 | --------------------------------------------------*/ 71 | export function inverse(p) { 72 | 73 | var x = p.x - this.x0; 74 | var y = p.y - this.y0; 75 | var lon, lat; 76 | 77 | if (this.sphere) { 78 | lat = HALF_PI - 2 * Math.atan(Math.exp(-y / (this.a * this.k0))); 79 | } 80 | else { 81 | var ts = Math.exp(-y / (this.a * this.k0)); 82 | lat = phi2z(this.e, ts); 83 | if (lat === -9999) { 84 | return null; 85 | } 86 | } 87 | lon = adjust_lon(this.long0 + x / (this.a * this.k0)); 88 | 89 | p.x = lon; 90 | p.y = lat; 91 | return p; 92 | } 93 | 94 | export var names = ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "merc"]; 95 | export default { 96 | init: init, 97 | forward: forward, 98 | inverse: inverse, 99 | names: names 100 | }; 101 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/mill.js: -------------------------------------------------------------------------------- 1 | import adjust_lon from '../common/adjust_lon'; 2 | 3 | /* 4 | reference 5 | "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder, 6 | The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355. 7 | */ 8 | 9 | 10 | /* Initialize the Miller Cylindrical projection 11 | -------------------------------------------*/ 12 | export function init() { 13 | //no-op 14 | } 15 | 16 | /* Miller Cylindrical forward equations--mapping lat,long to x,y 17 | ------------------------------------------------------------*/ 18 | export function forward(p) { 19 | var lon = p.x; 20 | var lat = p.y; 21 | /* Forward equations 22 | -----------------*/ 23 | var dlon = adjust_lon(lon - this.long0); 24 | var x = this.x0 + this.a * dlon; 25 | var y = this.y0 + this.a * Math.log(Math.tan((Math.PI / 4) + (lat / 2.5))) * 1.25; 26 | 27 | p.x = x; 28 | p.y = y; 29 | return p; 30 | } 31 | 32 | /* Miller Cylindrical inverse equations--mapping x,y to lat/long 33 | ------------------------------------------------------------*/ 34 | export function inverse(p) { 35 | p.x -= this.x0; 36 | p.y -= this.y0; 37 | 38 | var lon = adjust_lon(this.long0 + p.x / this.a); 39 | var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4); 40 | 41 | p.x = lon; 42 | p.y = lat; 43 | return p; 44 | } 45 | 46 | export var names = ["Miller_Cylindrical", "mill"]; 47 | export default { 48 | init: init, 49 | forward: forward, 50 | inverse: inverse, 51 | names: names 52 | }; 53 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/moll.js: -------------------------------------------------------------------------------- 1 | import adjust_lon from '../common/adjust_lon'; 2 | export function init() {} 3 | import {EPSLN} from '../constants/values'; 4 | /* Mollweide forward equations--mapping lat,long to x,y 5 | ----------------------------------------------------*/ 6 | export function forward(p) { 7 | 8 | /* Forward equations 9 | -----------------*/ 10 | var lon = p.x; 11 | var lat = p.y; 12 | 13 | var delta_lon = adjust_lon(lon - this.long0); 14 | var theta = lat; 15 | var con = Math.PI * Math.sin(lat); 16 | 17 | /* Iterate using the Newton-Raphson method to find theta 18 | -----------------------------------------------------*/ 19 | while (true) { 20 | var delta_theta = -(theta + Math.sin(theta) - con) / (1 + Math.cos(theta)); 21 | theta += delta_theta; 22 | if (Math.abs(delta_theta) < EPSLN) { 23 | break; 24 | } 25 | } 26 | theta /= 2; 27 | 28 | /* If the latitude is 90 deg, force the x coordinate to be "0 + false easting" 29 | this is done here because of precision problems with "cos(theta)" 30 | --------------------------------------------------------------------------*/ 31 | if (Math.PI / 2 - Math.abs(lat) < EPSLN) { 32 | delta_lon = 0; 33 | } 34 | var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0; 35 | var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0; 36 | 37 | p.x = x; 38 | p.y = y; 39 | return p; 40 | } 41 | 42 | export function inverse(p) { 43 | var theta; 44 | var arg; 45 | 46 | /* Inverse equations 47 | -----------------*/ 48 | p.x -= this.x0; 49 | p.y -= this.y0; 50 | arg = p.y / (1.4142135623731 * this.a); 51 | 52 | /* Because of division by zero problems, 'arg' can not be 1. Therefore 53 | a number very close to one is used instead. 54 | -------------------------------------------------------------------*/ 55 | if (Math.abs(arg) > 0.999999999999) { 56 | arg = 0.999999999999; 57 | } 58 | theta = Math.asin(arg); 59 | var lon = adjust_lon(this.long0 + (p.x / (0.900316316158 * this.a * Math.cos(theta)))); 60 | if (lon < (-Math.PI)) { 61 | lon = -Math.PI; 62 | } 63 | if (lon > Math.PI) { 64 | lon = Math.PI; 65 | } 66 | arg = (2 * theta + Math.sin(2 * theta)) / Math.PI; 67 | if (Math.abs(arg) > 1) { 68 | arg = 1; 69 | } 70 | var lat = Math.asin(arg); 71 | 72 | p.x = lon; 73 | p.y = lat; 74 | return p; 75 | } 76 | 77 | export var names = ["Mollweide", "moll"]; 78 | export default { 79 | init: init, 80 | forward: forward, 81 | inverse: inverse, 82 | names: names 83 | }; 84 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/ortho.js: -------------------------------------------------------------------------------- 1 | import adjust_lon from '../common/adjust_lon'; 2 | import asinz from '../common/asinz'; 3 | import {EPSLN, HALF_PI} from '../constants/values'; 4 | 5 | export function init() { 6 | //double temp; /* temporary variable */ 7 | 8 | /* Place parameters in static storage for common use 9 | -------------------------------------------------*/ 10 | this.sin_p14 = Math.sin(this.lat0); 11 | this.cos_p14 = Math.cos(this.lat0); 12 | } 13 | 14 | /* Orthographic forward equations--mapping lat,long to x,y 15 | ---------------------------------------------------*/ 16 | export function forward(p) { 17 | var sinphi, cosphi; /* sin and cos value */ 18 | var dlon; /* delta longitude value */ 19 | var coslon; /* cos of longitude */ 20 | var ksp; /* scale factor */ 21 | var g, x, y; 22 | var lon = p.x; 23 | var lat = p.y; 24 | /* Forward equations 25 | -----------------*/ 26 | dlon = adjust_lon(lon - this.long0); 27 | 28 | sinphi = Math.sin(lat); 29 | cosphi = Math.cos(lat); 30 | 31 | coslon = Math.cos(dlon); 32 | g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon; 33 | ksp = 1; 34 | if ((g > 0) || (Math.abs(g) <= EPSLN)) { 35 | x = this.a * ksp * cosphi * Math.sin(dlon); 36 | y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon); 37 | } 38 | p.x = x; 39 | p.y = y; 40 | return p; 41 | } 42 | 43 | export function inverse(p) { 44 | var rh; /* height above ellipsoid */ 45 | var z; /* angle */ 46 | var sinz, cosz; /* sin of z and cos of z */ 47 | var con; 48 | var lon, lat; 49 | /* Inverse equations 50 | -----------------*/ 51 | p.x -= this.x0; 52 | p.y -= this.y0; 53 | rh = Math.sqrt(p.x * p.x + p.y * p.y); 54 | z = asinz(rh / this.a); 55 | 56 | sinz = Math.sin(z); 57 | cosz = Math.cos(z); 58 | 59 | lon = this.long0; 60 | if (Math.abs(rh) <= EPSLN) { 61 | lat = this.lat0; 62 | p.x = lon; 63 | p.y = lat; 64 | return p; 65 | } 66 | lat = asinz(cosz * this.sin_p14 + (p.y * sinz * this.cos_p14) / rh); 67 | con = Math.abs(this.lat0) - HALF_PI; 68 | if (Math.abs(con) <= EPSLN) { 69 | if (this.lat0 >= 0) { 70 | lon = adjust_lon(this.long0 + Math.atan2(p.x, - p.y)); 71 | } 72 | else { 73 | lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y)); 74 | } 75 | p.x = lon; 76 | p.y = lat; 77 | return p; 78 | } 79 | lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz), rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz)); 80 | p.x = lon; 81 | p.y = lat; 82 | return p; 83 | } 84 | 85 | export var names = ["ortho"]; 86 | export default { 87 | init: init, 88 | forward: forward, 89 | inverse: inverse, 90 | names: names 91 | }; 92 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/poly.js: -------------------------------------------------------------------------------- 1 | import e0fn from '../common/e0fn'; 2 | import e1fn from '../common/e1fn'; 3 | import e2fn from '../common/e2fn'; 4 | import e3fn from '../common/e3fn'; 5 | import adjust_lon from '../common/adjust_lon'; 6 | import adjust_lat from '../common/adjust_lat'; 7 | import mlfn from '../common/mlfn'; 8 | import {EPSLN} from '../constants/values'; 9 | 10 | import gN from '../common/gN'; 11 | var MAX_ITER = 20; 12 | 13 | export function init() { 14 | /* Place parameters in static storage for common use 15 | -------------------------------------------------*/ 16 | this.temp = this.b / this.a; 17 | this.es = 1 - Math.pow(this.temp, 2); // devait etre dans tmerc.js mais n y est pas donc je commente sinon retour de valeurs nulles 18 | this.e = Math.sqrt(this.es); 19 | this.e0 = e0fn(this.es); 20 | this.e1 = e1fn(this.es); 21 | this.e2 = e2fn(this.es); 22 | this.e3 = e3fn(this.es); 23 | this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0); //si que des zeros le calcul ne se fait pas 24 | } 25 | 26 | /* Polyconic forward equations--mapping lat,long to x,y 27 | ---------------------------------------------------*/ 28 | export function forward(p) { 29 | var lon = p.x; 30 | var lat = p.y; 31 | var x, y, el; 32 | var dlon = adjust_lon(lon - this.long0); 33 | el = dlon * Math.sin(lat); 34 | if (this.sphere) { 35 | if (Math.abs(lat) <= EPSLN) { 36 | x = this.a * dlon; 37 | y = -1 * this.a * this.lat0; 38 | } 39 | else { 40 | x = this.a * Math.sin(el) / Math.tan(lat); 41 | y = this.a * (adjust_lat(lat - this.lat0) + (1 - Math.cos(el)) / Math.tan(lat)); 42 | } 43 | } 44 | else { 45 | if (Math.abs(lat) <= EPSLN) { 46 | x = this.a * dlon; 47 | y = -1 * this.ml0; 48 | } 49 | else { 50 | var nl = gN(this.a, this.e, Math.sin(lat)) / Math.tan(lat); 51 | x = nl * Math.sin(el); 52 | y = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, lat) - this.ml0 + nl * (1 - Math.cos(el)); 53 | } 54 | 55 | } 56 | p.x = x + this.x0; 57 | p.y = y + this.y0; 58 | return p; 59 | } 60 | 61 | /* Inverse equations 62 | -----------------*/ 63 | export function inverse(p) { 64 | var lon, lat, x, y, i; 65 | var al, bl; 66 | var phi, dphi; 67 | x = p.x - this.x0; 68 | y = p.y - this.y0; 69 | 70 | if (this.sphere) { 71 | if (Math.abs(y + this.a * this.lat0) <= EPSLN) { 72 | lon = adjust_lon(x / this.a + this.long0); 73 | lat = 0; 74 | } 75 | else { 76 | al = this.lat0 + y / this.a; 77 | bl = x * x / this.a / this.a + al * al; 78 | phi = al; 79 | var tanphi; 80 | for (i = MAX_ITER; i; --i) { 81 | tanphi = Math.tan(phi); 82 | dphi = -1 * (al * (phi * tanphi + 1) - phi - 0.5 * (phi * phi + bl) * tanphi) / ((phi - al) / tanphi - 1); 83 | phi += dphi; 84 | if (Math.abs(dphi) <= EPSLN) { 85 | lat = phi; 86 | break; 87 | } 88 | } 89 | lon = adjust_lon(this.long0 + (Math.asin(x * Math.tan(phi) / this.a)) / Math.sin(lat)); 90 | } 91 | } 92 | else { 93 | if (Math.abs(y + this.ml0) <= EPSLN) { 94 | lat = 0; 95 | lon = adjust_lon(this.long0 + x / this.a); 96 | } 97 | else { 98 | 99 | al = (this.ml0 + y) / this.a; 100 | bl = x * x / this.a / this.a + al * al; 101 | phi = al; 102 | var cl, mln, mlnp, ma; 103 | var con; 104 | for (i = MAX_ITER; i; --i) { 105 | con = this.e * Math.sin(phi); 106 | cl = Math.sqrt(1 - con * con) * Math.tan(phi); 107 | mln = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi); 108 | mlnp = this.e0 - 2 * this.e1 * Math.cos(2 * phi) + 4 * this.e2 * Math.cos(4 * phi) - 6 * this.e3 * Math.cos(6 * phi); 109 | ma = mln / this.a; 110 | dphi = (al * (cl * ma + 1) - ma - 0.5 * cl * (ma * ma + bl)) / (this.es * Math.sin(2 * phi) * (ma * ma + bl - 2 * al * ma) / (4 * cl) + (al - ma) * (cl * mlnp - 2 / Math.sin(2 * phi)) - mlnp); 111 | phi -= dphi; 112 | if (Math.abs(dphi) <= EPSLN) { 113 | lat = phi; 114 | break; 115 | } 116 | } 117 | 118 | //lat=phi4z(this.e,this.e0,this.e1,this.e2,this.e3,al,bl,0,0); 119 | cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat); 120 | lon = adjust_lon(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat)); 121 | } 122 | } 123 | 124 | p.x = lon; 125 | p.y = lat; 126 | return p; 127 | } 128 | 129 | export var names = ["Polyconic", "poly"]; 130 | export default { 131 | init: init, 132 | forward: forward, 133 | inverse: inverse, 134 | names: names 135 | }; 136 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/sinu.js: -------------------------------------------------------------------------------- 1 | import adjust_lon from '../common/adjust_lon'; 2 | import adjust_lat from '../common/adjust_lat'; 3 | import pj_enfn from '../common/pj_enfn'; 4 | var MAX_ITER = 20; 5 | import pj_mlfn from '../common/pj_mlfn'; 6 | import pj_inv_mlfn from '../common/pj_inv_mlfn'; 7 | import {EPSLN, HALF_PI} from '../constants/values'; 8 | 9 | import asinz from '../common/asinz'; 10 | 11 | 12 | export function init() { 13 | /* Place parameters in static storage for common use 14 | -------------------------------------------------*/ 15 | 16 | 17 | if (!this.sphere) { 18 | this.en = pj_enfn(this.es); 19 | } 20 | else { 21 | this.n = 1; 22 | this.m = 0; 23 | this.es = 0; 24 | this.C_y = Math.sqrt((this.m + 1) / this.n); 25 | this.C_x = this.C_y / (this.m + 1); 26 | } 27 | 28 | } 29 | 30 | /* Sinusoidal forward equations--mapping lat,long to x,y 31 | -----------------------------------------------------*/ 32 | export function forward(p) { 33 | var x, y; 34 | var lon = p.x; 35 | var lat = p.y; 36 | /* Forward equations 37 | -----------------*/ 38 | lon = adjust_lon(lon - this.long0); 39 | 40 | if (this.sphere) { 41 | if (!this.m) { 42 | lat = this.n !== 1 ? Math.asin(this.n * Math.sin(lat)) : lat; 43 | } 44 | else { 45 | var k = this.n * Math.sin(lat); 46 | for (var i = MAX_ITER; i; --i) { 47 | var V = (this.m * lat + Math.sin(lat) - k) / (this.m + Math.cos(lat)); 48 | lat -= V; 49 | if (Math.abs(V) < EPSLN) { 50 | break; 51 | } 52 | } 53 | } 54 | x = this.a * this.C_x * lon * (this.m + Math.cos(lat)); 55 | y = this.a * this.C_y * lat; 56 | 57 | } 58 | else { 59 | 60 | var s = Math.sin(lat); 61 | var c = Math.cos(lat); 62 | y = this.a * pj_mlfn(lat, s, c, this.en); 63 | x = this.a * lon * c / Math.sqrt(1 - this.es * s * s); 64 | } 65 | 66 | p.x = x; 67 | p.y = y; 68 | return p; 69 | } 70 | 71 | export function inverse(p) { 72 | var lat, temp, lon, s; 73 | 74 | p.x -= this.x0; 75 | lon = p.x / this.a; 76 | p.y -= this.y0; 77 | lat = p.y / this.a; 78 | 79 | if (this.sphere) { 80 | lat /= this.C_y; 81 | lon = lon / (this.C_x * (this.m + Math.cos(lat))); 82 | if (this.m) { 83 | lat = asinz((this.m * lat + Math.sin(lat)) / this.n); 84 | } 85 | else if (this.n !== 1) { 86 | lat = asinz(Math.sin(lat) / this.n); 87 | } 88 | lon = adjust_lon(lon + this.long0); 89 | lat = adjust_lat(lat); 90 | } 91 | else { 92 | lat = pj_inv_mlfn(p.y / this.a, this.es, this.en); 93 | s = Math.abs(lat); 94 | if (s < HALF_PI) { 95 | s = Math.sin(lat); 96 | temp = this.long0 + p.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(lat)); 97 | //temp = this.long0 + p.x / (this.a * Math.cos(lat)); 98 | lon = adjust_lon(temp); 99 | } 100 | else if ((s - EPSLN) < HALF_PI) { 101 | lon = this.long0; 102 | } 103 | } 104 | p.x = lon; 105 | p.y = lat; 106 | return p; 107 | } 108 | 109 | export var names = ["Sinusoidal", "sinu"]; 110 | export default { 111 | init: init, 112 | forward: forward, 113 | inverse: inverse, 114 | names: names 115 | }; 116 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/somerc.js: -------------------------------------------------------------------------------- 1 | /* 2 | references: 3 | Formules et constantes pour le Calcul pour la 4 | projection cylindrique conforme à axe oblique et pour la transformation entre 5 | des systèmes de référence. 6 | http://www.swisstopo.admin.ch/internet/swisstopo/fr/home/topics/survey/sys/refsys/switzerland.parsysrelated1.31216.downloadList.77004.DownloadFile.tmp/swissprojectionfr.pdf 7 | */ 8 | 9 | export function init() { 10 | var phy0 = this.lat0; 11 | this.lambda0 = this.long0; 12 | var sinPhy0 = Math.sin(phy0); 13 | var semiMajorAxis = this.a; 14 | var invF = this.rf; 15 | var flattening = 1 / invF; 16 | var e2 = 2 * flattening - Math.pow(flattening, 2); 17 | var e = this.e = Math.sqrt(e2); 18 | this.R = this.k0 * semiMajorAxis * Math.sqrt(1 - e2) / (1 - e2 * Math.pow(sinPhy0, 2)); 19 | this.alpha = Math.sqrt(1 + e2 / (1 - e2) * Math.pow(Math.cos(phy0), 4)); 20 | this.b0 = Math.asin(sinPhy0 / this.alpha); 21 | var k1 = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2)); 22 | var k2 = Math.log(Math.tan(Math.PI / 4 + phy0 / 2)); 23 | var k3 = Math.log((1 + e * sinPhy0) / (1 - e * sinPhy0)); 24 | this.K = k1 - this.alpha * k2 + this.alpha * e / 2 * k3; 25 | } 26 | 27 | export function forward(p) { 28 | var Sa1 = Math.log(Math.tan(Math.PI / 4 - p.y / 2)); 29 | var Sa2 = this.e / 2 * Math.log((1 + this.e * Math.sin(p.y)) / (1 - this.e * Math.sin(p.y))); 30 | var S = -this.alpha * (Sa1 + Sa2) + this.K; 31 | 32 | // spheric latitude 33 | var b = 2 * (Math.atan(Math.exp(S)) - Math.PI / 4); 34 | 35 | // spheric longitude 36 | var I = this.alpha * (p.x - this.lambda0); 37 | 38 | // psoeudo equatorial rotation 39 | var rotI = Math.atan(Math.sin(I) / (Math.sin(this.b0) * Math.tan(b) + Math.cos(this.b0) * Math.cos(I))); 40 | 41 | var rotB = Math.asin(Math.cos(this.b0) * Math.sin(b) - Math.sin(this.b0) * Math.cos(b) * Math.cos(I)); 42 | 43 | p.y = this.R / 2 * Math.log((1 + Math.sin(rotB)) / (1 - Math.sin(rotB))) + this.y0; 44 | p.x = this.R * rotI + this.x0; 45 | return p; 46 | } 47 | 48 | export function inverse(p) { 49 | var Y = p.x - this.x0; 50 | var X = p.y - this.y0; 51 | 52 | var rotI = Y / this.R; 53 | var rotB = 2 * (Math.atan(Math.exp(X / this.R)) - Math.PI / 4); 54 | 55 | var b = Math.asin(Math.cos(this.b0) * Math.sin(rotB) + Math.sin(this.b0) * Math.cos(rotB) * Math.cos(rotI)); 56 | var I = Math.atan(Math.sin(rotI) / (Math.cos(this.b0) * Math.cos(rotI) - Math.sin(this.b0) * Math.tan(rotB))); 57 | 58 | var lambda = this.lambda0 + I / this.alpha; 59 | 60 | var S = 0; 61 | var phy = b; 62 | var prevPhy = -1000; 63 | var iteration = 0; 64 | while (Math.abs(phy - prevPhy) > 0.0000001) { 65 | if (++iteration > 20) { 66 | //...reportError("omercFwdInfinity"); 67 | return; 68 | } 69 | //S = Math.log(Math.tan(Math.PI / 4 + phy / 2)); 70 | S = 1 / this.alpha * (Math.log(Math.tan(Math.PI / 4 + b / 2)) - this.K) + this.e * Math.log(Math.tan(Math.PI / 4 + Math.asin(this.e * Math.sin(phy)) / 2)); 71 | prevPhy = phy; 72 | phy = 2 * Math.atan(Math.exp(S)) - Math.PI / 2; 73 | } 74 | 75 | p.x = lambda; 76 | p.y = phy; 77 | return p; 78 | } 79 | 80 | export var names = ["somerc"]; 81 | export default { 82 | init: init, 83 | forward: forward, 84 | inverse: inverse, 85 | names: names 86 | }; 87 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/sterea.js: -------------------------------------------------------------------------------- 1 | import gauss from './gauss'; 2 | import adjust_lon from '../common/adjust_lon'; 3 | 4 | export function init() { 5 | gauss.init.apply(this); 6 | if (!this.rc) { 7 | return; 8 | } 9 | this.sinc0 = Math.sin(this.phic0); 10 | this.cosc0 = Math.cos(this.phic0); 11 | this.R2 = 2 * this.rc; 12 | if (!this.title) { 13 | this.title = "Oblique Stereographic Alternative"; 14 | } 15 | } 16 | 17 | export function forward(p) { 18 | var sinc, cosc, cosl, k; 19 | p.x = adjust_lon(p.x - this.long0); 20 | gauss.forward.apply(this, [p]); 21 | sinc = Math.sin(p.y); 22 | cosc = Math.cos(p.y); 23 | cosl = Math.cos(p.x); 24 | k = this.k0 * this.R2 / (1 + this.sinc0 * sinc + this.cosc0 * cosc * cosl); 25 | p.x = k * cosc * Math.sin(p.x); 26 | p.y = k * (this.cosc0 * sinc - this.sinc0 * cosc * cosl); 27 | p.x = this.a * p.x + this.x0; 28 | p.y = this.a * p.y + this.y0; 29 | return p; 30 | } 31 | 32 | export function inverse(p) { 33 | var sinc, cosc, lon, lat, rho; 34 | p.x = (p.x - this.x0) / this.a; 35 | p.y = (p.y - this.y0) / this.a; 36 | 37 | p.x /= this.k0; 38 | p.y /= this.k0; 39 | if ((rho = Math.sqrt(p.x * p.x + p.y * p.y))) { 40 | var c = 2 * Math.atan2(rho, this.R2); 41 | sinc = Math.sin(c); 42 | cosc = Math.cos(c); 43 | lat = Math.asin(cosc * this.sinc0 + p.y * sinc * this.cosc0 / rho); 44 | lon = Math.atan2(p.x * sinc, rho * this.cosc0 * cosc - p.y * this.sinc0 * sinc); 45 | } 46 | else { 47 | lat = this.phic0; 48 | lon = 0; 49 | } 50 | 51 | p.x = lon; 52 | p.y = lat; 53 | gauss.inverse.apply(this, [p]); 54 | p.x = adjust_lon(p.x + this.long0); 55 | return p; 56 | } 57 | 58 | export var names = ["Stereographic_North_Pole", "Oblique_Stereographic", "Polar_Stereographic", "sterea","Oblique Stereographic Alternative"]; 59 | export default { 60 | init: init, 61 | forward: forward, 62 | inverse: inverse, 63 | names: names 64 | }; 65 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/utm.js: -------------------------------------------------------------------------------- 1 | import adjust_zone from '../common/adjust_zone'; 2 | import etmerc from './etmerc'; 3 | export var dependsOn = 'etmerc'; 4 | import {D2R} from '../constants/values'; 5 | 6 | 7 | export function init() { 8 | var zone = adjust_zone(this.zone, this.long0); 9 | if (zone === undefined) { 10 | throw new Error('unknown utm zone'); 11 | } 12 | this.lat0 = 0; 13 | this.long0 = ((6 * Math.abs(zone)) - 183) * D2R; 14 | this.x0 = 500000; 15 | this.y0 = this.utmSouth ? 10000000 : 0; 16 | this.k0 = 0.9996; 17 | 18 | etmerc.init.apply(this); 19 | this.forward = etmerc.forward; 20 | this.inverse = etmerc.inverse; 21 | } 22 | 23 | export var names = ["Universal Transverse Mercator System", "utm"]; 24 | export default { 25 | init: init, 26 | names: names, 27 | dependsOn: dependsOn 28 | }; 29 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/projections/vandg.js: -------------------------------------------------------------------------------- 1 | import adjust_lon from '../common/adjust_lon'; 2 | 3 | import {HALF_PI, EPSLN} from '../constants/values'; 4 | 5 | import asinz from '../common/asinz'; 6 | 7 | /* Initialize the Van Der Grinten projection 8 | ----------------------------------------*/ 9 | export function init() { 10 | //this.R = 6370997; //Radius of earth 11 | this.R = this.a; 12 | } 13 | 14 | export function forward(p) { 15 | 16 | var lon = p.x; 17 | var lat = p.y; 18 | 19 | /* Forward equations 20 | -----------------*/ 21 | var dlon = adjust_lon(lon - this.long0); 22 | var x, y; 23 | 24 | if (Math.abs(lat) <= EPSLN) { 25 | x = this.x0 + this.R * dlon; 26 | y = this.y0; 27 | } 28 | var theta = asinz(2 * Math.abs(lat / Math.PI)); 29 | if ((Math.abs(dlon) <= EPSLN) || (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN)) { 30 | x = this.x0; 31 | if (lat >= 0) { 32 | y = this.y0 + Math.PI * this.R * Math.tan(0.5 * theta); 33 | } 34 | else { 35 | y = this.y0 + Math.PI * this.R * -Math.tan(0.5 * theta); 36 | } 37 | // return(OK); 38 | } 39 | var al = 0.5 * Math.abs((Math.PI / dlon) - (dlon / Math.PI)); 40 | var asq = al * al; 41 | var sinth = Math.sin(theta); 42 | var costh = Math.cos(theta); 43 | 44 | var g = costh / (sinth + costh - 1); 45 | var gsq = g * g; 46 | var m = g * (2 / sinth - 1); 47 | var msq = m * m; 48 | var con = Math.PI * this.R * (al * (g - msq) + Math.sqrt(asq * (g - msq) * (g - msq) - (msq + asq) * (gsq - msq))) / (msq + asq); 49 | if (dlon < 0) { 50 | con = -con; 51 | } 52 | x = this.x0 + con; 53 | //con = Math.abs(con / (Math.PI * this.R)); 54 | var q = asq + g; 55 | con = Math.PI * this.R * (m * q - al * Math.sqrt((msq + asq) * (asq + 1) - q * q)) / (msq + asq); 56 | if (lat >= 0) { 57 | //y = this.y0 + Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con); 58 | y = this.y0 + con; 59 | } 60 | else { 61 | //y = this.y0 - Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con); 62 | y = this.y0 - con; 63 | } 64 | p.x = x; 65 | p.y = y; 66 | return p; 67 | } 68 | 69 | /* Van Der Grinten inverse equations--mapping x,y to lat/long 70 | ---------------------------------------------------------*/ 71 | export function inverse(p) { 72 | var lon, lat; 73 | var xx, yy, xys, c1, c2, c3; 74 | var a1; 75 | var m1; 76 | var con; 77 | var th1; 78 | var d; 79 | 80 | /* inverse equations 81 | -----------------*/ 82 | p.x -= this.x0; 83 | p.y -= this.y0; 84 | con = Math.PI * this.R; 85 | xx = p.x / con; 86 | yy = p.y / con; 87 | xys = xx * xx + yy * yy; 88 | c1 = -Math.abs(yy) * (1 + xys); 89 | c2 = c1 - 2 * yy * yy + xx * xx; 90 | c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys; 91 | d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27; 92 | a1 = (c1 - c2 * c2 / 3 / c3) / c3; 93 | m1 = 2 * Math.sqrt(-a1 / 3); 94 | con = ((3 * d) / a1) / m1; 95 | if (Math.abs(con) > 1) { 96 | if (con >= 0) { 97 | con = 1; 98 | } 99 | else { 100 | con = -1; 101 | } 102 | } 103 | th1 = Math.acos(con) / 3; 104 | if (p.y >= 0) { 105 | lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI; 106 | } 107 | else { 108 | lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI; 109 | } 110 | 111 | if (Math.abs(xx) < EPSLN) { 112 | lon = this.long0; 113 | } 114 | else { 115 | lon = adjust_lon(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx); 116 | } 117 | 118 | p.x = lon; 119 | p.y = lat; 120 | return p; 121 | } 122 | 123 | export var names = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"]; 124 | export default { 125 | init: init, 126 | forward: forward, 127 | inverse: inverse, 128 | names: names 129 | }; 130 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/transform.js: -------------------------------------------------------------------------------- 1 | import {D2R, R2D, PJD_3PARAM, PJD_7PARAM} from './constants/values'; 2 | import datum_transform from './datum_transform'; 3 | import adjust_axis from './adjust_axis'; 4 | import proj from './Proj'; 5 | import toPoint from './common/toPoint'; 6 | import checkSanity from './checkSanity'; 7 | 8 | function checkNotWGS(source, dest) { 9 | return ((source.datum.datum_type === PJD_3PARAM || source.datum.datum_type === PJD_7PARAM) && dest.datumCode !== 'WGS84') || ((dest.datum.datum_type === PJD_3PARAM || dest.datum.datum_type === PJD_7PARAM) && source.datumCode !== 'WGS84'); 10 | } 11 | 12 | export default function transform(source, dest, point) { 13 | var wgs84; 14 | if (Array.isArray(point)) { 15 | point = toPoint(point); 16 | } 17 | checkSanity(point); 18 | // Workaround for datum shifts towgs84, if either source or destination projection is not wgs84 19 | if (source.datum && dest.datum && checkNotWGS(source, dest)) { 20 | wgs84 = new proj('WGS84'); 21 | point = transform(source, wgs84, point); 22 | source = wgs84; 23 | } 24 | // DGR, 2010/11/12 25 | if (source.axis !== 'enu') { 26 | point = adjust_axis(source, false, point); 27 | } 28 | // Transform source points to long/lat, if they aren't already. 29 | if (source.projName === 'longlat') { 30 | point = { 31 | x: point.x * D2R, 32 | y: point.y * D2R 33 | }; 34 | } 35 | else { 36 | if (source.to_meter) { 37 | point = { 38 | x: point.x * source.to_meter, 39 | y: point.y * source.to_meter 40 | }; 41 | } 42 | point = source.inverse(point); // Convert Cartesian to longlat 43 | } 44 | // Adjust for the prime meridian if necessary 45 | if (source.from_greenwich) { 46 | point.x += source.from_greenwich; 47 | } 48 | 49 | // Convert datums if needed, and if possible. 50 | point = datum_transform(source.datum, dest.datum, point); 51 | 52 | // Adjust for the prime meridian if necessary 53 | if (dest.from_greenwich) { 54 | point = { 55 | x: point.x - dest.from_greenwich, 56 | y: point.y 57 | }; 58 | } 59 | 60 | if (dest.projName === 'longlat') { 61 | // convert radians to decimal degrees 62 | point = { 63 | x: point.x * R2D, 64 | y: point.y * R2D 65 | }; 66 | } else { // else project 67 | point = dest.forward(point); 68 | if (dest.to_meter) { 69 | point = { 70 | x: point.x / dest.to_meter, 71 | y: point.y / dest.to_meter 72 | }; 73 | } 74 | } 75 | 76 | // DGR, 2010/11/12 77 | if (dest.axis !== 'enu') { 78 | return adjust_axis(dest, true, point); 79 | } 80 | 81 | return point; 82 | } 83 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/lib/version.js: -------------------------------------------------------------------------------- 1 | export {version as default} from '../package.json'; 2 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "proj4", 3 | "version": "2.4.4-alpha", 4 | "description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.", 5 | "main": "dist/proj4-src.js", 6 | "module": "lib/index.js", 7 | "directories": { 8 | "test": "test", 9 | "doc": "docs" 10 | }, 11 | "scripts": { 12 | "build": "grunt", 13 | "build:tmerc": "grunt build:tmerc", 14 | "test": "npm run build && istanbul test _mocha test/test.js" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "git://github.com/proj4js/proj4js.git" 19 | }, 20 | "author": "", 21 | "license": "MIT", 22 | "devDependencies": { 23 | "grunt-cli": "~0.1.13", 24 | "grunt": "~0.4.2", 25 | "grunt-contrib-connect": "~0.6.0", 26 | "grunt-contrib-jshint": "~1.1.0", 27 | "chai": "~1.8.1", 28 | "mocha": "~1.17.1", 29 | "grunt-mocha-phantomjs": "~0.4.0", 30 | "rollup": "^0.41.4", 31 | "rollup-plugin-json": "^2.0.1", 32 | "rollup-plugin-node-resolve": "^2.0.0", 33 | "grunt-rollup": "^1.0.1", 34 | "grunt-contrib-uglify": "~0.11.1", 35 | "curl": "git://github.com/cujojs/curl.git", 36 | "istanbul": "~0.2.4", 37 | "tin": "~0.4.0" 38 | }, 39 | "dependencies": { 40 | "mgrs": "1.0.0", 41 | "wkt-parser": "^1.2.0" 42 | } 43 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/projs.js: -------------------------------------------------------------------------------- 1 | import tmerc from './lib/projections/tmerc'; 2 | import etmerc from './lib/projections/etmerc'; 3 | import utm from './lib/projections/utm'; 4 | import sterea from './lib/projections/sterea'; 5 | import stere from './lib/projections/stere'; 6 | import somerc from './lib/projections/somerc'; 7 | import omerc from './lib/projections/omerc'; 8 | import lcc from './lib/projections/lcc'; 9 | import krovak from './lib/projections/krovak'; 10 | import cass from './lib/projections/cass'; 11 | import laea from './lib/projections/laea'; 12 | import aea from './lib/projections/aea'; 13 | import gnom from './lib/projections/gnom'; 14 | import cea from './lib/projections/cea'; 15 | import eqc from './lib/projections/eqc'; 16 | import poly from './lib/projections/poly'; 17 | import nzmg from './lib/projections/nzmg'; 18 | import mill from './lib/projections/mill'; 19 | import sinu from './lib/projections/sinu'; 20 | import moll from './lib/projections/moll'; 21 | import eqdc from './lib/projections/eqdc'; 22 | import vandg from './lib/projections/vandg'; 23 | import aeqd from './lib/projections/aeqd'; 24 | import ortho from './lib/projections/ortho'; 25 | import qsc from './lib/projections/qsc'; 26 | export default function(proj4){ 27 | proj4.Proj.projections.add(tmerc); 28 | proj4.Proj.projections.add(etmerc); 29 | proj4.Proj.projections.add(utm); 30 | proj4.Proj.projections.add(sterea); 31 | proj4.Proj.projections.add(stere); 32 | proj4.Proj.projections.add(somerc); 33 | proj4.Proj.projections.add(omerc); 34 | proj4.Proj.projections.add(lcc); 35 | proj4.Proj.projections.add(krovak); 36 | proj4.Proj.projections.add(cass); 37 | proj4.Proj.projections.add(laea); 38 | proj4.Proj.projections.add(aea); 39 | proj4.Proj.projections.add(gnom); 40 | proj4.Proj.projections.add(cea); 41 | proj4.Proj.projections.add(eqc); 42 | proj4.Proj.projections.add(poly); 43 | proj4.Proj.projections.add(nzmg); 44 | proj4.Proj.projections.add(mill); 45 | proj4.Proj.projections.add(sinu); 46 | proj4.Proj.projections.add(moll); 47 | proj4.Proj.projections.add(eqdc); 48 | proj4.Proj.projections.add(vandg); 49 | proj4.Proj.projections.add(aeqd); 50 | proj4.Proj.projections.add(ortho); 51 | proj4.Proj.projections.add(qsc); 52 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # get current version 4 | VERSION=$(npm ls --json=true proj4js | grep version | awk '{ print $2}'| sed -e 's/^"//' -e 's/"$//') 5 | 6 | # Build 7 | git checkout -b build 8 | node_modules/.bin/grunt 9 | git add dist -f 10 | git commit -m "build $VERSION" 11 | 12 | # Tag and push 13 | git tag $VERSION 14 | git push --tags git@github.com:proj4js/proj4js.git $VERSION 15 | 16 | # Publish 17 | npm publish 18 | 19 | # Cleanup 20 | git checkout master 21 | git branch -D build 22 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4js/AUTHORS: -------------------------------------------------------------------------------- 1 | Mike Adair 2 | Richard Greenwood 3 | Calvin Metcalf 4 | Richard Marsden (http://www.winwaed.com) 5 | #credit for 6 | #src/projCode/gnom.js 7 | #src/projCode/cea.js 8 | T. Mittan 9 | #credit for 10 | #src/projCode/eqdc.js 11 | #src/projCode/equi.js 12 | #src/projCode/merc.js 13 | #src/projCode/mill.js 14 | #src/projCode/omerc.js 15 | #src/projCode/ortho.js 16 | #src/projCode/poly.js 17 | #src/projCode/poly.js 18 | D. Steinwand 19 | #credit for 20 | #src/projCode/merc.js 21 | #src/projCode/laea.js 22 | #src/projCode/moll.js 23 | S. Nelson 24 | #credit for 25 | #src/projCode/moll.js -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4js/LICENSE.md: -------------------------------------------------------------------------------- 1 | ##Proj4js -- Javascript reprojection library. 2 | 3 | Authors: 4 | - Mike Adair madairATdmsolutions.ca 5 | - Richard Greenwood richATgreenwoodmap.com 6 | - Didier Richard didier.richardATign.fr 7 | - Stephen Irons stephen.ironsATclear.net.nz 8 | - Olivier Terral oterralATgmail.com 9 | - Calvin Metcalf cmetcalfATappgeo.com 10 | 11 | Copyright (c) 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf 12 | 13 | Permission is hereby granted, free of charge, to any person obtaining a 14 | copy of this software and associated documentation files (the "Software"), 15 | to deal in the Software without restriction, including without limitation 16 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 17 | and/or sell copies of the Software, and to permit persons to whom the 18 | Software is furnished to do so, subject to the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be included 21 | in all copies or substantial portions of the Software. 22 | 23 | _THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 24 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 26 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 28 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 29 | DEALINGS IN THE SOFTWARE._ -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4js/REFERENCES.md: -------------------------------------------------------------------------------- 1 | 1. Snyder, John P., "Map Projections--A Working Manual", U.S. Geological Survey 2 | Professional Paper 1395 (Supersedes USGS Bulletin 1532), 3 | United State Government Printing Office, Washington D.C., 1987. 4 | 2. Snyder, John P. and Voxland, Philip M., "An Album of Map Projections", 5 | U.S. Geological Survey Professional Paper 1453 , 6 | United State Government Printing Office, Washington D.C., 1989. 7 | 3. "Cartographic Projection Procedures for the UNIX Environment- 8 | A User's Manual" by Gerald I. Evenden, 9 | USGS Open File Report 90-284and Release 4 Interim Reports (2003) 10 | 4. Snyder, John P., "Flattening the Earth - 11 | Two Thousand Years of Map Projections", Univ. Chicago Press, 1993 12 | 5. Wolfram Mathworld "Gnomonic Projection" 13 | http://mathworld.wolfram.com/GnomonicProjection.html 14 | Accessed: 12th November 2009 15 | 6. "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder, 16 | The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355. 17 | 7. Snyder, John P., "Map Projections--A Working Manual", U.S. Geological 18 | Survey Professional Paper 1395 (Supersedes USGS Bulletin 1532), United 19 | State Government Printing Office, Washington D.C., 1987. 20 | 8. "Software Documentation for GCTP General Cartographic Transformation 21 | Package", U.S. Geological Survey National Mapping Division, May 1982. 22 | 9. Department of Land and Survey Technical Circular 1973/32 23 | http://www.linz.govt.nz/docs/miscellaneous/nz-map-definition.pdf 24 | 10. OSG Technical Report 4.1 25 | http://www.linz.govt.nz/docs/miscellaneous/nzmg.pdf 26 | 11. Formules et constantes pour le Calcul pour la 27 | projection cylindrique conforme à axe oblique et pour la transformation entre 28 | des systèmes de référence. 29 | http://www.swisstopo.admin.ch/internet/swisstopo/fr/home/topics/survey/sys/refsys/switzerland.parsysrelated1.31216.downloadList.77004.DownloadFile.tmp/swissprojectionfr.pdf -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4leaflet/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Proj4Leaflet", 3 | "version": "0.7.2", 4 | "homepage": "https://github.com/kartena/Proj4Leaflet", 5 | "authors": [ 6 | "Per Liedman (https://github.com/perliedman/)" 7 | ], 8 | "description": "Smooth Proj4js integration with Leaflet", 9 | "moduleType": [ 10 | "amd", 11 | "node" 12 | ], 13 | "main": [ 14 | "src/proj4leaflet.js" 15 | ], 16 | "keywords": [ 17 | "Leaflet", 18 | "Project4" 19 | ], 20 | "license": "MIT", 21 | "ignore": [ 22 | "**/.*", 23 | "node_modules", 24 | "bower_components", 25 | "test", 26 | "lib", 27 | "examples", 28 | "tests" 29 | ], 30 | "dependencies": { 31 | "proj4": "~2.1.2", 32 | "leaflet": "~0.7.2" 33 | }, 34 | "_release": "0.7.2", 35 | "_resolution": { 36 | "type": "version", 37 | "tag": "0.7.2", 38 | "commit": "22b8542a74b115ddc675220f918fce298771c82a" 39 | }, 40 | "_source": "git://github.com/kartena/Proj4Leaflet.git", 41 | "_target": "~0.7.2", 42 | "_originalSource": "proj4leaflet", 43 | "_direct": true 44 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4leaflet/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Kartena AB 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 20 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4leaflet/README.md: -------------------------------------------------------------------------------- 1 | Proj4Leaflet [![NPM version](https://badge.fury.io/js/proj4leaflet.png)](http://badge.fury.io/js/proj4leaflet) 2 | ============ 3 | 4 | This [Leaflet](http://leafletjs.com) plugin adds support for using projections supported by 5 | [Proj4js](https://github.com/proj4js/proj4js). 6 | 7 | *For compatibility with Leaflet 1.0-beta1 use the leaflet-proj-refactor branch.* 8 | 9 | ## Features 10 | 11 | * Supports all commonly used projections 12 | * Extends Leaflet with full TMS support even for local projections 13 | * Makes it easy to use GeoJSON data with other projections than WGS84 14 | * Image overlays with bounds set from projected coordinates rather than `LatLngs` 15 | 16 | Leaflet comes with built in support for tiles in [Spherical Mercator](http://wiki.openstreetmap.org/wiki/EPSG:3857). If you need support for tile layers in other projections, the Proj4Leaflet plugin lets you use tiles in any projection supported by Proj4js, which means support for just about any projection commonly used. 17 | 18 | For more details and API docs, see the [Proj4Leaflet site](http://kartena.github.io/Proj4Leaflet/). 19 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4leaflet/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Proj4Leaflet", 3 | "version": "0.7.2", 4 | "homepage": "https://github.com/kartena/Proj4Leaflet", 5 | "authors": [ 6 | "Per Liedman (https://github.com/perliedman/)" 7 | ], 8 | "description": "Smooth Proj4js integration with Leaflet", 9 | "moduleType": [ 10 | "amd", 11 | "node" 12 | ], 13 | "main": [ 14 | "src/proj4leaflet.js" 15 | ], 16 | "keywords": [ 17 | "Leaflet", 18 | "Project4" 19 | ], 20 | "license": "MIT", 21 | "ignore": [ 22 | "**/.*", 23 | "node_modules", 24 | "bower_components", 25 | "test", 26 | "lib", 27 | "examples", 28 | "tests" 29 | ], 30 | "dependencies": { 31 | "proj4": "~2.1.2", 32 | "leaflet": "~0.7.2" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/proj4leaflet/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "proj4leaflet", 3 | "version": "0.7.2", 4 | "description": "Smooth Proj4js integration with Leaflet", 5 | "main": "src/proj4leaflet.js", 6 | "directories": { 7 | "test": "test", 8 | "example": "examples" 9 | }, 10 | "scripts": { 11 | "test": "echo \"Error: no test specified\" && exit 1" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git://github.com/kartena/Proj4Leaflet.git" 16 | }, 17 | "keywords": [ 18 | "maps", 19 | "proj4", 20 | "projection", 21 | "leaflet" 22 | ], 23 | "author": "Per Liedman (https://github.com/perliedman/)", 24 | "contributors": [ 25 | "Mattias Bengtsson (https://github.com/moonlite/)", 26 | "Christopher Fredén (https://github.com/icetan/)", 27 | "Peter Thorin (https://github.com/pthorin/)", 28 | "S. Andrew Sheppard (https://github.com/sheppard)", 29 | "Leigh Hunt (https://github.com/leighghunt/)", 30 | "Vladimir Agafonkin (https://github.com/mourner)", 31 | "Mathieu Leplatre (https://github.com/leplatrem)", 32 | "fnicollet (https://github.com/fnicollet)" 33 | ], 34 | "license": "MIT", 35 | "bugs": { 36 | "url": "https://github.com/kartena/Proj4Leaflet/issues" 37 | }, 38 | "dependencies": { 39 | "leaflet": "~0.7.0", 40 | "proj4": "~2.0.0" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/shp2geojson/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Gipong 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/shp2geojson/README.md: -------------------------------------------------------------------------------- 1 | # shp2geojson.js 2 | Convert shapefile to geoJSON via a web browser without Server-Side code. This conversion will unzip your file and reproject the data with correct encoding in JavaScript. 3 | 4 | Inspired by this project by wavded http://github.com/wavded/js-shapefile-to-geojson 5 | 6 | # Demo 7 | http://gipong.github.io/shp2geojson.js/ 8 | 9 | # Usage 10 | Include all of the necessary files for the webpage to preview shp. 11 | 12 | ``` 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | ``` 23 | 24 | Load the ZIP archive that must contain the .shp and .dbf files and replace the .prj file of shapefile with EPSG code. 25 | 26 | Two options available if you need to set the EPSG or encoding for best fit to your data. 27 | You can skip EPSG code field if your ZIP archive contain the .prj file. 28 | 29 | ```JavaScript 30 | loadshp({ 31 | url: '/shp/test.zip', // path or your upload file 32 | encoding: 'big5' // default utf-8 33 | EPSG: 3826 // default 4326 34 | }, function(geojson) { 35 | // geojson returned 36 | }); 37 | ``` 38 | 39 | #### Use with Leaflet.js 40 | ```JavaScript 41 | var map = L.map('map').setView([ 0, 0 ], 10), 42 | vector = L.geoJson().addTo(map); 43 | 44 | L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png' , { maxZoom: 18}).addTo(map); 45 | 46 | loadshp({ 47 | url: '/shp/test.zip', 48 | encoding: 'big5', 49 | EPSG: 3826 50 | }, function(data) { 51 | vector.addData(data); 52 | map.fitBounds(vector.getBounds()); 53 | }); 54 | ``` 55 | 56 | 57 | #### Use with Google Maps API v3 58 | ```JavaScript 59 | var map = new google.maps.Map(document.getElementById('map'), { 60 | zoom: 10, 61 | center: {lat: 0, lng: 0} 62 | }); 63 | 64 | loadshp({ 65 | url: '/shp/test.zip', 66 | encoding: 'big5', 67 | EPSG: 3826 68 | }, function(data) { 69 | var bounds = new google.maps.LatLngBounds(), 70 | bbox = data.bbox; 71 | 72 | map.data.addGeoJson(data); 73 | bounds.extend(new google.maps.LatLng (bbox[1], bbox[0])); 74 | bounds.extend(new google.maps.LatLng (bbox[3], bbox[2])) 75 | map.fitBounds(bounds); 76 | }); 77 | ``` 78 | 79 | # License 80 | The MIT License (MIT) 81 | 82 | Copyright (c) 2015 Gipong 83 | 84 | Permission is hereby granted, free of charge, to any person obtaining a copy 85 | of this software and associated documentation files (the "Software"), to deal 86 | in the Software without restriction, including without limitation the rights 87 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 88 | copies of the Software, and to permit persons to whom the Software is 89 | furnished to do so, subject to the following conditions: 90 | 91 | The above copyright notice and this permission notice shall be included in all 92 | copies or substantial portions of the Software. 93 | 94 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 95 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 96 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 97 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 98 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 99 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 100 | SOFTWARE. 101 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/spinjs/spin.js: -------------------------------------------------------------------------------- 1 | //fgnass.github.com/spin.js#v2.0.1 2 | !function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k=1.4.2", 34 | "_originalSource": "underscore" 35 | } -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/underscore/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative 2 | Reporters & Editors 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/underscore/README.md: -------------------------------------------------------------------------------- 1 | __ 2 | /\ \ __ 3 | __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ 4 | /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ 5 | \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ 6 | \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ 7 | \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ 8 | \ \____/ 9 | \/___/ 10 | 11 | Underscore.js is a utility-belt library for JavaScript that provides 12 | support for the usual functional suspects (each, map, reduce, filter...) 13 | without extending any core JavaScript objects. 14 | 15 | For Docs, License, Tests, and pre-packed downloads, see: 16 | http://underscorejs.org 17 | 18 | Underscore is an open-sourced component of DocumentCloud: 19 | https://github.com/documentcloud 20 | 21 | Many thanks to our contributors: 22 | https://github.com/jashkenas/underscore/contributors 23 | -------------------------------------------------------------------------------- /ckanext/geoview/public/js/vendor/underscore/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "underscore", 3 | "version": "1.8.3", 4 | "main": "underscore.js", 5 | "keywords": ["util", "functional", "server", "client", "browser"], 6 | "ignore" : ["docs", "test", "*.yml", "CNAME", "index.html", "favicon.ico", "CONTRIBUTING.md", ".*", "component.json", "package.json", "karma.*"] 7 | } 8 | -------------------------------------------------------------------------------- /ckanext/geoview/public/resource.config: -------------------------------------------------------------------------------- 1 | [IE conditional] 2 | 3 | 4 | [groups] 5 | 6 | openlayers = 7 | css/ol_preview.css 8 | js/vendor/openlayers/ol.css 9 | js/vendor/ol-helpers/ol-helpers.css 10 | js/vendor/underscore/underscore.js 11 | js/vendor/proj4/dist/proj4-src.js 12 | js/vendor/openlayers/ol.js 13 | js/vendor/ol-helpers/ol-helpers.js 14 | js/vendor/ol-helpers/ol-layer-switcher.js 15 | js/ol_preview.js 16 | 17 | geo-resource-styles = 18 | css/geo-resource-styles.css 19 | 20 | geojson = 21 | js/vendor/leaflet/dist/leaflet.js 22 | js/vendor/leaflet/dist/leaflet.css 23 | js/vendor/proj4js/proj4.js 24 | js/vendor/proj4leaflet/src/proj4leaflet.js 25 | js/common_map.js 26 | js/geojson_preview.js 27 | css/geojson_preview.css 28 | 29 | wmts = 30 | js/vendor/leaflet/dist/leaflet.js 31 | js/vendor/proj4js/proj4.js 32 | js/common_map.js 33 | js/wmts_preview.js 34 | 35 | js/vendor/leaflet/dist/leaflet.css 36 | css/wmts_preview.css 37 | 38 | bootstrap2 = 39 | js/vendor/bootstrap2/bootstrap.js 40 | js/vendor/bootstrap2/bootstrap.css 41 | 42 | shp = 43 | js/vendor/leaflet/dist/leaflet.js 44 | js/vendor/proj4js/proj4.js 45 | js/vendor/spinjs/spin.js 46 | js/vendor/leaflet.spin/leaflet.spin.js 47 | js/vendor/shp2geojson/preview.js 48 | js/vendor/shp2geojson/preprocess.js 49 | js/vendor/jszip/jszip.js 50 | js/vendor/jszip/jszip-utils.js 51 | js/common_map.js 52 | js/shp_preview.js 53 | 54 | js/vendor/leaflet/dist/leaflet.css 55 | css/shp_preview.css 56 | -------------------------------------------------------------------------------- /ckanext/geoview/public/webassets.yml: -------------------------------------------------------------------------------- 1 | openlayers_js: 2 | filter: rjsmin 3 | output: ckanext-geoview/%(version)s_openlayers.js 4 | extra: 5 | preload: 6 | - base/main 7 | contents: 8 | - js/vendor/underscore/underscore.js 9 | - js/vendor/proj4/dist/proj4-src.js 10 | - js/vendor/openlayers/ol-debug.js 11 | - js/vendor/ol-helpers/ol-helpers.js 12 | - js/vendor/ol-helpers/ol-layer-switcher.js 13 | - js/ol_preview.js 14 | openlayers_css: 15 | output: ckanext-geoview/%(version)s_openlayers.css 16 | contents: 17 | - css/ol_preview.css 18 | - js/vendor/openlayers/ol.css 19 | - js/vendor/ol-helpers/ol-helpers.css 20 | 21 | geo-resource-styles_css: 22 | output: ckanext-geoview/%(version)s_geo-resource-styles.css 23 | contents: 24 | css/geo-resource-styles.css 25 | 26 | geojson_js: 27 | filter: rjsmin 28 | output: ckanext-geoview/%(version)s_geojson.js 29 | extra: 30 | preload: 31 | - base/main 32 | contents: 33 | - js/vendor/leaflet/dist/leaflet.js 34 | - js/vendor/proj4js/proj4.js 35 | - js/vendor/proj4leaflet/src/proj4leaflet.js 36 | - js/common_map.js 37 | - js/geojson_preview.js 38 | geojson_css: 39 | output: ckanext-geoview/%(version)s_geojson.css 40 | contents: 41 | - js/vendor/leaflet/dist/leaflet.css 42 | - css/geojson_preview.css 43 | 44 | wmts_js: 45 | filter: rjsmin 46 | output: ckanext-geoview/%(version)s_wmts.js 47 | extra: 48 | preload: 49 | - base/main 50 | contents: 51 | - js/vendor/leaflet/dist/leaflet.js 52 | - js/vendor/proj4js/proj4.js 53 | - js/common_map.js 54 | - js/wmts_preview.js 55 | wmts_css: 56 | output: ckanext-geoview/%(version)s_wmts.css 57 | contents: 58 | - js/vendor/leaflet/dist/leaflet.css 59 | - css/wmts_preview.css 60 | 61 | bootstrap2_js: 62 | filter: rjsmin 63 | output: ckanext-geoview/%(version)s_bootstrap2.js 64 | extra: 65 | preload: 66 | - base/main 67 | contents: 68 | - js/vendor/bootstrap2/bootstrap.js 69 | bootstrap2_css: 70 | output: ckanext-geoview/%(version)s_bootstrap2.css 71 | contents: 72 | - js/vendor/bootstrap2/bootstrap.css 73 | 74 | shp_js: 75 | filter: rjsmin 76 | output: ckanext-geoview/%(version)s_shp.js 77 | extra: 78 | preload: 79 | - base/main 80 | contents: 81 | - js/vendor/leaflet/dist/leaflet.js 82 | - js/vendor/proj4js/proj4.js 83 | - js/vendor/spinjs/spin.js 84 | - js/vendor/leaflet.spin/leaflet.spin.js 85 | - js/vendor/shp2geojson/preview.js 86 | - js/vendor/shp2geojson/preprocess.js 87 | - js/vendor/jszip/jszip.js 88 | - js/vendor/jszip/jszip-utils.js 89 | - js/common_map.js 90 | - js/shp_preview.js 91 | shp_css: 92 | output: ckanext-geoview/%(version)s_shp.css 93 | contents: 94 | - js/vendor/leaflet/dist/leaflet.css 95 | - css/shp_preview.css 96 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/base.html: -------------------------------------------------------------------------------- 1 | {% ckan_extends %} 2 | 3 | {% block styles %} 4 | {{ super() }} 5 | {% set type = 'asset' if h.ckan_version().split('.')[1] | int >= 9 else 'resource' %} 6 | {% include 'geoview/snippets/geo-resource-styles_' ~ type ~ '.html' %} 7 | {% endblock %} 8 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/dataviewer/base_form.html: -------------------------------------------------------------------------------- 1 | {% import 'macros/form.html' as form %} 2 | 3 | {% block form %} 4 | 5 | {{ form.select('common_map.type', label=_('Map Type'), options=[{'text':'Default (OSM)', 'value':''},{'text':'Custom', 'value': 'custom'},{'text':'MapBox', 'value': 'mapbox'}], selected=data['common_map.type'], error=errors['common_map.type']) }} 6 | {{ form.input('common_map.custom.url', label=_('Custom URL'), value=data['common_map.custom.url'], error=errors['common_map.custom.url']) }} 7 | 8 | {% endblock %} 9 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/dataviewer/geojson.html: -------------------------------------------------------------------------------- 1 | {% extends "dataviewer/base.html" %} 2 | 3 | {% block page %} 4 | {%- block styles %} 5 | {% set type = 'asset' if h.ckan_version().split('.')[1] | int >= 9 else 'resource' %} 6 | {% include 'geoview/snippets/geojson_' ~ type ~ '.html' %} 7 | {% endblock %} 8 | {% set map_config = h.get_common_map_config_geojson() %} 9 |
14 |

15 |
16 |
{{ _('Loading...') }}
17 |

18 |
19 | 20 | {% endblock %} 21 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/dataviewer/openlayers.html: -------------------------------------------------------------------------------- 1 | {% extends "dataviewer/base.html" %} 2 | 3 | {% block page %} 4 | 5 | {% set map_config = h.get_common_map_config_geoviews() %} 6 | {% set ol_config = h.get_openlayers_viewer_config() %} 7 |
8 |
19 |

20 |
21 |
{{ _('Loading...') }}
22 |

23 |
24 |
25 | 26 | {% set type = 'asset' if h.ckan_version().split('.')[1] | int >= 9 else 'resource' %} 27 | {% include 'geoview/snippets/openlayers_' ~ type ~ '.html' %} 28 | 29 | {% endblock %} 30 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/dataviewer/openlayers_form.html: -------------------------------------------------------------------------------- 1 | {% import 'macros/form.html' as form %} 2 | 3 | {{ form.checkbox('feature_hoveron', label=_('Display Feature Info on Hover'), value=True, checked=data.feature_hoveron, error=errors.feature_hoveron) }} 4 | 5 | {{ form.textarea('feature_style', label=_('Feature style descriptor'), value=data.feature_style, error=errors.feature_style) }} 6 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/dataviewer/shp.html: -------------------------------------------------------------------------------- 1 | {% extends "dataviewer/base.html" %} 2 | 3 | {% block page %} 4 | {%- block styles %} 5 | {% set type = 'asset' if h.ckan_version().split('.')[1] | int >= 9 else 'resource' %} 6 | {% include 'geoview/snippets/shp_' ~ type ~ '.html' %} 7 | {% endblock %} 8 | 9 | {% set map_config = h.get_common_map_config_shp() %} 10 | {% set shp_config = h.get_shapefile_viewer_config() %} 11 |
12 |

13 |
14 |
{{ _('Loading...') }}
15 |

16 |
17 | 18 | {% block scripts %} 19 | 22 | {% endblock %} 23 | 24 | {% endblock %} 25 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/dataviewer/wmts.html: -------------------------------------------------------------------------------- 1 | {% extends "dataviewer/base.html" %} 2 | 3 | {% block page %} 4 | {% set map_config = h.get_common_map_config_wmts() %} 5 |
6 |

7 |
8 |
{{ _('Loading...') }}
9 |

10 |
11 | 12 | {% resource 'ckanext-geoview/wmts' %} 13 | 14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/geoview/snippets/geo-resource-styles_asset.html: -------------------------------------------------------------------------------- 1 | {% asset 'ckanext-geoview/geo-resource-styles_css' %} 2 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/geoview/snippets/geo-resource-styles_resource.html: -------------------------------------------------------------------------------- 1 | {% resource 'ckanext-geoview/geo-resource-styles' %} 2 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/geoview/snippets/geojson_asset.html: -------------------------------------------------------------------------------- 1 | {% set main_css = h.get_rtl_css() if h.is_rtl_language() else g.main_css %} 2 | {# strip '/base/' prefix and '.css' suffix #} 3 | {% asset main_css[6:-4] %} 4 | 5 | {% asset 'ckanext-geoview/geojson_js' %} 6 | {% asset 'ckanext-geoview/geojson_css' %} 7 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/geoview/snippets/geojson_resource.html: -------------------------------------------------------------------------------- 1 | {% resource g.main_css[6:] %} 2 | {% resource 'ckanext-geoview/geojson' %} 3 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/geoview/snippets/openlayers_asset.html: -------------------------------------------------------------------------------- 1 | {% asset 'ckanext-geoview/openlayers_js' %} 2 | {% asset 'ckanext-geoview/openlayers_css' %} 3 | 4 | {% asset 'ckanext-geoview/bootstrap2_js' %} 5 | {% asset 'ckanext-geoview/bootstrap2_css' %} 6 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/geoview/snippets/openlayers_resource.html: -------------------------------------------------------------------------------- 1 | {% resource 'ckanext-geoview/openlayers' %} 2 | {% resource 'ckanext-geoview/bootstrap2' %} 3 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/geoview/snippets/shp_asset.html: -------------------------------------------------------------------------------- 1 | {% set main_css = h.get_rtl_css() if h.is_rtl_language() else g.main_css %} 2 | {# strip '/base/' prefix and '.css' suffix #} 3 | {% asset main_css[6:-4] %} 4 | 5 | {% asset 'ckanext-geoview/shp_js' %} 6 | {% asset 'ckanext-geoview/shp_css' %} 7 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/geoview/snippets/shp_resource.html: -------------------------------------------------------------------------------- 1 | {% resource g.main_css[6:] %} 2 | {% resource 'ckanext-geoview/shp' %} 3 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/geoview/snippets/wmts_asset.html: -------------------------------------------------------------------------------- 1 | {% asset 'ckanext-geoview/wmts_js' %} 2 | {% asset 'ckanext-geoview/wmts_css' %} 3 | -------------------------------------------------------------------------------- /ckanext/geoview/templates/geoview/snippets/wmts_resource.html: -------------------------------------------------------------------------------- 1 | {% resource 'ckanext-geoview/wmts' %} 2 | -------------------------------------------------------------------------------- /ckanext/geoview/views.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import logging 4 | 5 | from flask import Blueprint 6 | 7 | import ckan.lib.base as base 8 | 9 | from ckan import plugins as p 10 | 11 | import ckanext.geoview.utils as utils 12 | 13 | log = logging.getLogger(__name__) 14 | service_proxy = Blueprint("service_proxy", __name__) 15 | 16 | 17 | def proxy_service(id, resource_id): 18 | data_dict = {"resource_id": resource_id} 19 | context = { 20 | "model": base.model, 21 | "session": base.model.Session, 22 | "user": base.c.user or base.c.author, 23 | } 24 | return utils.proxy_service_resource(p.toolkit.request, context, data_dict) 25 | 26 | 27 | def proxy_service_url(map_id): 28 | url = base.config.get("ckanext.spatial.common_map." + map_id + ".url") 29 | req = p.toolkit.request 30 | return utils.proxy_service_url(req, url) 31 | 32 | 33 | def get_blueprints(): 34 | return [service_proxy] 35 | 36 | 37 | service_proxy.add_url_rule( 38 | "/dataset//resource//service_proxy", 39 | view_func=proxy_service, 40 | ) 41 | service_proxy.add_url_rule( 42 | "/basemap_service/", view_func=proxy_service_url 43 | ) 44 | -------------------------------------------------------------------------------- /pip-requirements.txt: -------------------------------------------------------------------------------- 1 | requests>=1.1.0 2 | ckantoolkit 3 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | version = '0.0.18' 4 | 5 | setup( 6 | name='ckanext-geoview', 7 | version=version, 8 | description='CKAN Geospatial ResourceView', 9 | long_description=''' ''', 10 | classifiers=[], 11 | keywords='', 12 | author='Philippe Duchesne', 13 | author_email='pduchesne@gmail.com', 14 | url='http://github.com/ckan/ckanext-geoview', 15 | license='MIT', 16 | packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), 17 | namespace_packages=['ckanext'], 18 | include_package_data=True, 19 | zip_safe=False, 20 | install_requires=[ 21 | # -*- Extra requirements: -*- 22 | ], 23 | entry_points=''' 24 | [ckan.plugins] 25 | geo_view=ckanext.geoview.plugin:OLGeoView 26 | geojson_view=ckanext.geoview.plugin:GeoJSONView 27 | wmts_view=ckanext.geoview.plugin:WMTSView 28 | shp_view=ckanext.geoview.plugin:SHPView 29 | ''', 30 | ) 31 | --------------------------------------------------------------------------------