Questions tagged [geojson]

GeoJSON, a format rooted in JSON, allows for the encoding of geographical information and is accessible to all.

What is the best way to integrate GeoJSON data into my next.js application using Leaflet?

I am encountering an issue in my Next.js app while trying to display multiple locations on a leaflet map using a GeoJSON data file. Everything works fine when I have just one location displayed on the map, but as soon as I import additional data and attemp ...

Generating a fresh GeoJSON LineString by utilizing the information from JSON items and incorporating a certain property

I need to combine multiple JSON objects into a GeoJSON feature collection with LineStrings Here are some example poorly formatted JSON objects: {"lat":16.0269337,"lon":40.073042,"score":1,"ID":"13800006252028","TYPES":"Regional","N2C":"2","NAME":"Strada ...

Converting JSON data into GeoJSON format using JavaScript

Currently, I am in the process of reading a JSON file and formatting it for GeoJSON function getAddress(id,search,vagas, next) { geo.geocode({address:search}, function (results,status) { if (status == google.maps.GeocoderStatus.OK) { ...

Leverage PHP to retrieve information from a JSON file and integrate it into a dropdown menu on an HTML

I've been given a task to develop a PHP routine that will extract the ISO code and name from a geojson file for use in a dropdown list of countries on a website. This is completely new to me and I'm finding it difficult to understand the documentation. I ...

Decoding GeoJSON: Extracting a feature from an array

I am currently working on a map project where I am drawing polygons with properties pulled from a JSON file. Each polygon is colored based on feature values in the JSON file. Here's an example of a feature in the JSON file: { "type": "Feature", " ...

Transform GEOSwift.JSON into a Swift struct

In my GEOSwift implementation, I have a feature structured like this: { "type" : "Feature", "geometry" : { "type" : "Point", "coordinates" : [ -xx.xxxxxxxxxxxxxxx, xx.xxxxx ...

Error extracting geographical keys from mongoose schema with geojson data

My mongodb collection had a specific schema, but I recently made an update to include lat/lon coordinates. Original version: var schema = mongoose.Schema({ id: String, name: String, address: String, city: String, zip: String, coun ...

Using Custom GeoJSON Data with HighMaps Tutorial

Currently, I have created a custom .geo.json file from a county shapefile using ogr2ogr. My goal is to manually add values for each county. After studying a jsfiddle example (link provided), I'm unsure how to merge the two together. The specific line ...

I'm experiencing an issue with loading the GeoJSON file on my localhost

I included this vector into my local host code, but the JSON file does not seem to load. geojson_layer = new OpenLayers.Layer.Vector("features", { projection: epsg4326, strategies: [new OpenLayers.Strategy.Fixed()], pro ...

Importing a geoJSON object directly onto Google Maps V3

I am currently working on developing a map using floor plans stored in mongodb. Instead of saving the JSON data into a file and calling it with map.data.loadGeoJson('myfile.json'), I want to create an object directly for better efficiency. Below ...

Utilizing the zIndex property on a map label does not produce any impact when combined with a GeoJSON layer

Utilizing the Google map label tool, I am trying to showcase certain property from GeoJSON data on a GeoJSON layer. However, the issue arises as the layer has a dark color and the label is appearing blurry behind the GeoJSON data layer. Despite attempting ...

What are the benefits of declaring variables with JSON in a JavaScript file instead of simply reading JSON data?

Lately, I've been delving into the world of leaflets and exploring various plugins. Some of the plugins I've come across (like Leaflet.markercluster) utilize JSON to map out points. However, instead of directly using the JSON stream or a JSON fi ...

leafletjs: render Points of Interest (POIs) using canvas technology

I am looking for a way to efficiently draw multiple geo points using Leaflet and HTML5 canvas. My data source is geoJSON, but according to the documentation of Leaflet, drawing geo positions as canvas is currently not supported. var anotherGeojsonLayer = ...

Utilizing JSON API data to populate Leaflet maps

I am currently working on fetching JSON data from an API call, extracting the latitude, longitude, and name variables to create a GeoJSON array, and then displaying it on a Leaflet map. Despite not encountering any errors in the console, the geojson appea ...

What is the best way to handle KML/GeoJSON data in Node.js?

I've come to a point where I've exhausted all my Google searches and now asking for help here. Currently, we are processing a KML file using geoXml3 on the client side. However, ideally, I would like to preprocess it on the server side and then send the po ...

What could be causing this GeoJSON file to be incorrect?

Currently, I am dealing with a GeoJSON file that has the following structure: [ { "geometry": { "type": "Point", "coordinates": [ 35.109876, 32.711323 ] }, ...

Unable to "serialize" geoJSON information

While working with Leaflet JavaScript, I am attempting to retrieve data directly from GeoServer using an Ajax link. To display it nicely in a DataTables table, I need to convert it into JSON format as per DataTables instructions. However, I keep encounteri ...

The formatting of my GeoJSON file is preventing LeafLet from properly rendering the points within the layer

I'm currently utilizing the leaflet-ajax project (https://github.com/calvinmetcalf/leaflet-ajax) and my objective is to define a geojsonLayer variable in the following manner: var geojsonLayer = L.geoJson.ajax("http://localhost:7070/findInArea"); The end ...

What is the reason for the Circle to Polygon node module producing an oval or ellipse shape instead of a circle shape?

I've been experimenting with the npm package circle-to-polygon and I crafted the following code to generate a polygon that resembles a circle. const circleToPolygon = require('circle-to-polygon'); let coordinates = [28.612484207825005, 77.23574939044147] ...

Issue: nodebuffer is incompatible with this platform

Currently, I am attempting to utilize the Shpjs package in order to import a Shape file onto a Leaflet map. According to the Shpjs documentation: shpjs Below is the code snippet I am working with: const [geoData, setGeoData] = useState(null); //stat ...

What is the best way to arrange a GeoJSON features array based on a specific property value?

I need help sorting a GeoJSON file based on a property and then slicing it to keep only the top 5 features. For instance, I want to take this GeoJSON and arrange it in descending order by the incidents property: ... [ -75.1972382872565 ...

Leaflet GeoJSON Turf library encountered an error: Invalid coordinates for LatLng object: (undefined, undefined)

After setting the return to null for the component and condition in question to check the data being returned, I thoroughly examined the coordinates arrays without finding any issues. The data comes in as an array of geometry collections containing linest ...