Projection
See original GitHub issueI have this service ArcGIS Server convert the point where GeoJSON . to convert moving slightly upward
i use esri leaflet is goog
angular
.module('geomarketing.services')
.factory('utilityService', ['$q', '$log','$http',
function ($q, $log,$http) {
var utilityService = {};
utilityService.arcgisToFeatureCollection = '';
utilityService.arcgisToFeatureCollection = function (url, callback) {
$http.get(url).
success(function (data, status, headers, config) {
callback(null, createGeoJson(data));
// this callback will be called asynchronously
// when the response is available
}).
error(function (data, status, headers, config) {
callback(null, null);
});
createGeoJson = function (json) {
var features = json.features;
//var idField = response.operationalLayers[0].featureCollection.layers[0].layerDefinition.objectIdField;
// empty geojson feature collection
var featureCollection = {
type: 'FeatureCollection',
features: []
};
for (var i = features.length - 1; i >= 0; i--) {
// convert ArcGIS Feature to GeoJSON Feature
var feature = {
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [features[i].geometry.x, features[i].geometry.y] },
"properties": features[i].attributes
};
// unproject the web mercator coordinates to lat/lng
var latlng = L.Projection.Mercator.unproject(L.point(feature.geometry.coordinates));
feature.geometry.coordinates = [latlng.lng, latlng.lat];
featureCollection.features.push(feature);
}
return featureCollection
};
};
return utilityService;
}]);
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Projection | Definition, Theories, & Facts - Britannica
projection, the mental process by which people attribute to others what is in their own minds. For example, individuals who are in a ......
Read more >Projection Definition & Meaning - Merriam-Webster
Kids Definition ; 1 · a method of showing a curved surface (as the earth) on a flat one (as a map) ;...
Read more >Psychological projection - Wikipedia
Psychological projection is the process of misinterpreting what is "inside" as coming from "outside". It forms the basis of empathy by the projection...
Read more >Projection in Psychology: Definition, Defense Mechanism ...
In psychology, projection refers to placing your own negative traits or unwanted emotions onto others, usually without reason. We'll dive into why humans...
Read more >What Is Projection as a Defense Mechanism? - Verywell Mind
Projection is when one sees the traits that they find unacceptable in themselves in others. Learn about the origin and impact of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @ibrahimawadhamid, one of the problems may be the projection with which you have published the ArcgisSever service. If you can send me some code with pleasure I can help you.
This is my code to consume the service (Require the Leaflet / esri-leaflet.js library):
http://esri.github.io/esri-leaflet/examples/parse-feature-collection.html in this sample using L.Projection.Mercator.unproject() for convert to geojson. I need convert for generate buffer with turfjs but marker moved upward.
thanks