Exploring GeoJSON
For more than a decade, GeoJSON has been one of the simplest and most developer-friendly formats for representing geographic data. ThinkGeo has supported GeoJSON across our UI controls and core libraries for years, but the geospatial landscape is changing fast.
With the explosive growth of AI and no-code automation tools, GeoJSON has quietly become one of the most popular formats for location-based data exchange.
In this post, we’ll break down why GeoJSON is more important than ever, how ThinkGeo supports it across our platform, and how you can leverage our APIs today to load, display, edit, and analyze GeoJSON with just a few lines of code.
Tip
To see live examples using GeoJson in ThinkGeo, just clone the HowDoI samples, run the solution and then click on the GeoJson sample in the left panel.
While the sample above is using ThinkGeo Desktop for WPF, the GeoJson functionality work the same in our Mobile and Web components.
Why GeoJSON Is Becoming Even More Popular Today
GeoJSON started as a simple, web-friendly GIS format. But in today’s world of AI-assisted development, microservices, and browser-based geospatial tools, it has evolved into one of the most important open standards for modern GIS. As AI models become more prevalent, GeoJSON will continue to grow in popularity.
Modern AI models (including ChatGPT, Claude, Gemini, Grok, and others) can generate GeoJSON on the fly. Developers can prompt things like:
“Give me a driving area within 15 minutes of this point.”
“Analyze hotspots in this dataset and return polygons.”
And the model can respond with GeoJSON. That means developers increasingly need mapping tools that can ingest GeoJSON directly, without preprocessing steps. ThinkGeo makes this seamless.
GeoJSON And ThinkGeo
Whether you’re building on WPF, WinForms, Blazor, WebApi or MAUI, you can load GeoJSON with just a few lines of code. It’s important to note in the examples below that an InMemoryFeatureLayer is used as the container for all GeoJSON features. This is a practical design decision due to GeoJSON typically having smaller datasets. In the rare scenarios where have ultra-large GeoJSON datasets, there are other options available with binary or custom layers.
The example below is taken from the ‘Display GeoJson File’ sample in the Desktop HowDoI samples. The code simply uses the static CreateFeatureFromGeoJson and CreateFeaturesFromGeoJson functions in the Feature class to create GeoJson from any file, string or stream and then add them to the InternalFeatures property of the Layer.
// Create the Overlay and new InMemoryFeatureLayer and set up a Projection Converter to convert from the json's Decimal Degree data to Spherical Mercator.
var layerOverlay = new LayerOverlay();
var pittsburghHistoricalDistrictsLayer = new InMemoryFeatureLayer();
// Load all of our geojson features.
var jsonText = File.ReadAllText(@"./Data/GeoJson/pittsburghpacity-designated-historic-districts.geojson");
Collection historicalDistrictFeatures = Feature.CreateFeaturesFromGeoJson(jsonText);
// Add each json feature to our layer - use Internal Features since the json is in the unprojected 4326. If you use FeatureSource.AddFeature(f), then you need to reproject the feature first.
historicalDistrictFeatures.ToList().ForEach(f => pittsburghHistoricalDistrictsLayer.InternalFeatures.Add(f));
pittsburghHistoricalDistrictsLayer.BuildIndex();
// Add a simple area style and text style, and add the layer to the overlay.
pittsburghHistoricalDistrictsLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyle.CreateSimpleAreaStyle(new GeoColor(200, GeoColors.LightOrange), GeoColors.Red);
pittsburghHistoricalDistrictsLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyle.CreateSimpleTextStyle("historic_name", "Segoe UI", 12, DrawingFontStyles.Bold, GeoColors.Black, GeoColors.White, 2);
pittsburghHistoricalDistrictsLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
layerOverlay.Layers.Add(pittsburghHistoricalDistrictsLayer);
MapView.Overlays.Add(layerOverlay);
That’s all there is to it! In the example above, the GeoJSON comes from a file, but in the real world, the example would work the same with data from a stream or api call. And once your GeoJSON features are in the InMemoryFeatureLayer, it will behave like any other layer and allow you to style, query, manipulate or reproject based on the needs of your project.
Connect With Us
We hope you found today’s post useful. If you have questions or topics you'd like us to cover in future posts, we’d love to hear from you! Email us at sales@thinkgeo.com or schedule a meeting to talk in person. We always enjoy connecting with our customers, learning how you’re using ThinkGeo, and exploring new ways to improve our products.
About ThinkGeo
We are a GIS software company founded in 2004 and located in Frisco, TX. Our clients are in more than 40 industries including agriculture, energy, transportation, government, engineering, IT, and defense. We pride ourselves on our excellent service and transparency. ThinkGeo offers a variety of products and services to meet almost any GIS application need. We can even help you develop your next project - anywhere from a few hours of consulting to outsourcing an entire project. To learn more, email us at sales@thinkgeo.com, or call us direct at 1-214-449-0330.