AnsweredAssumed Answered

Importing CSV File with special spatial reference

Question asked by FloCAD on Mar 13, 2017
Latest reply on Mar 14, 2017 by FloCAD

Hi everyone,

I have a little problem when trying to import a csv file with wkid 102110 (french projection) but each time, the reference wkid still in 4326. Is it normal to keep this wkid ?

 

See my code below :

esriLoader.dojoRequire(["esri/basemaps",
"esri/map",
"esri/layers/CSVLayer",
"esri/Color",
"esri/symbols/SimpleMarkerSymbol",
"esri/renderers/SimpleRenderer",
"esri/InfoTemplate",
"esri/urlUtils",
"esri/geometry/Extent",
"esri/SpatialReference",
"esri/geometry/Point",
"dojo/domReady!"], (esriBasemaps, Map, CSVLayer, Color, SimpleMarkerSymbol, SimpleRenderer, InfoTemplate, urlUtils, Extent, SpatialReference, Point) => {
esriBasemaps.myservice = {
baseMapLayers: [{url: "http://<myserver>/arcgis/rest/services/<myService/MapServer"}
],
title: "myservice"
};

let map = new Map(this.refs['map'], {
basemap: "myservice",
zoom: 0,
extent: new Extent({
xmax: 1438371.080139373,
xmin: -98371.08013937285,
ymax: 7185000,
ymin: 5975000, spatialReference: {wkid: 102110}
})
});
map.spatialReference = new SpatialReference({wkid: 102110});
map.on("load", () => {

 

let csv = new CSVLayer(process.env.PUBLIC_URL + "/data/Coor_CO.csv", {
latitudeFieldName: 'X_LIEU',
longitudeFieldName: 'Y_LIEU',
columnDelimiter: ';'

});

let orangeRed = new Color([238, 69, 0, 0.5]); // hex is #ff4500
let marker = new SimpleMarkerSymbol("solid", 15, null, orangeRed);
let renderer = new SimpleRenderer(marker);
csv.setRenderer(renderer);
csv.fullExtent = new Extent({
xmax: 1438371.080139373,
xmin: -98371.08013937285,
ymax: 7185000,
ymin: 5975000, spatialReference: {wkid: 102110}
});
csv.spatialReference.wkid = 102110;
map.addLayer(csv);
});
}
)

 

thx by advance =)

Outcomes