
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Django speaking WFS 2.0 to expose geo data.
For more details, see: https://django-gisserver.readthedocs.io/
docker compose up
.Install the module in your project:
pip install django-gisserver
Add it to the INSTALLED_APPS
:
INSTALLED_APPS = [
...
"gisserver",
]
Create a model that exposes a GeoDjango field:
from django.contrib.gis.db.models import PointField
from django.db import models
class Restaurant(models.Model):
name = models.CharField(max_length=200)
location = PointField(null=True)
def __str__(self):
return self.name
Write a view that exposes this model as a WFS feature:
from gisserver.crs import CRS, CRS84, WEB_MERCATOR
from gisserver.features import FeatureType, ServiceDescription
from gisserver.views import WFSView
from .models import Restaurant
# As example, the local coordinate system for The Netherlands
RD_NEW = CRS.from_string("urn:ogc:def:crs:EPSG::28992")
class PlacesWFSView(WFSView):
"""An simple view that uses the WFSView against our test model."""
xml_namespace = "http://example.org/gisserver"
# The service metadata
service_description = ServiceDescription(
title="Places",
abstract="Unittesting",
keywords=["django-gisserver"],
provider_name="Django",
provider_site="https://www.example.com/",
contact_person="django-gisserver",
)
# Each Django model is listed here as a feature.
feature_types = [
FeatureType(
Restaurant.objects.all(),
fields="__all__",
other_crs=[RD_NEW, CRS84, WEB_MERCATOR]
),
]
Use that view in the URLConf:
from django.urls import path
from . import views
urlpatterns = [
path("/wfs/places/", views.PlacesWFSView.as_view()),
]
You can now use http://localhost:8000/wfs/places/ in your GIS application. It will perform requests such as:
By adding &OUTPUTFORMAT=geojson
or &OUTPUTFORMAT=csv
to the GetFeature
request, the GeoJSON and CSV outputs are returned.
The CSV output has an unlimited page size, as it's quite performant.
The "datapunt" team of the Municipality of Amsterdam develops software for the municipality. Much of this software is then published as Open Source so that other municipalities, organizations and citizens can use the software as a basis and inspiration to develop similar software themselves. The Municipality of Amsterdam considers it important that software developed with public money is also publicly available.
This package is initially developed by the City of Amsterdam, but the tools and concepts created in this project can be used in any city.
FAQs
Django speaking WFS 2.0 (exposing GeoDjango model fields)
We found that django-gisserver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.