How can I read a geojson file in angular (PD: I want to consume it as a web services, as well as json but in this case with geojson extension) (This is the structure)
{
"type": "FeatureCollection",
"name": "datosG",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::32614" } },
"features": [
{ "type": "Feature", "properties": { "OBJECTID_1": 128472, "OBJECTID": 290914, "PERIMETRO": 0.0, "X_COORD": 437737.6081, "Y_COORD": 2134066.62689, "ZONA": "0", "MANZANA": "0", "PREDIO": "0", "EDIFICIO": "0", "DEPTO": "0", "CLAVEZONA": "0", "DELEGACION": "0", "SERMED": 0, "NIS": 5018729, "FECHA": "0", "OBS": "0", "FOTO": "0", "NIP": 0, "TP": 0, "CAPA": "0", "DUPL": 0, "MOD": "0", "REV": "0", "D_CP": "0", "SHAPE_AREA": 49.75133801, "SHAPE_LEN": 28.561161905300001 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 437741.79, 2134063.73 ], [ 437739.25, 2134063.66 ], [ 437733.569199999794364, 2134063.4821 ], [ 437733.523299999535084, 2134065.245799999684 ], [ 437733.454099999741, 2134067.901799999177 ], [ 437733.411600000225008, 2134069.5347 ], [ 437739.120000000111759, 2134069.68 ], [ 437741.679999999701977, 2134069.74 ], [ 437741.759999999776483, 2134065.51 ], [ 437741.79, 2134063.73 ] ] ] ] } },
{ "type": "Feature", "properties": { "OBJECTID_1": 128475, "OBJECTID": 23478, "PERIMETRO": 0.0, "X_COORD": 437644.56176000001, "Y_COORD": 2134016.79904, "ZONA": "0", "MANZANA": "0", "PREDIO": "0", "EDIFICIO": "0", "DEPTO": "0", "CLAVEZONA": "0", "DELEGACION": "0", "SERMED": 0, "NIS": 5018838, "FECHA": "0", "OBS": "0", "FOTO": "0", "NIP": 0, "TP": 0, "CAPA": "0", "DUPL": 0, "MOD": "0", "REV": "0", "D_CP": "0", "SHAPE_AREA": 63.77637337, "SHAPE_LEN": 33.4279660957 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 437650.051900000311434, 2134013.946299999952 ], [ 437647.240000000223517, 2134013.9 ], [ 437639.22, 2134013.76 ], [ 437639.089999999850988, 2134019.66 ], [ 437644.519999999552965, 2134019.75 ], [ 437648.129999999888241, 2134019.8 ], [ 437649.897900000214577, 2134019.828099999577 ], [ 437649.940499999560416, 2134018.2017 ], [ 437650.009999999776483, 2134015.5458 ], [ 437650.051900000311434, 2134013.946299999952 ] ] ] ] } },
Now, what I'm trying to do is consume the service as a json like this example
private Jalar() {
const url = this.dir;
return this._http.get(url)
.map((res: Response) => res.json())
.subscribe(solicitud => {
this.dts.total = solicitud.totalSolicitudes;
this.dts.solic = solicitud.solicitudesPorPagina;
this.dts.max = solicitud.maxPaginas;
console.log('dts', this.dts);
});
}
but in this case I do not know how to enter the data and be able to extract the coordinates from the file
In advance, I appreciate your support ...