Skip to content

sergioedo/ra-data-geoserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ra-data-geoserver

A data provider for react-admin for building admin applications with geospatial data on top of GeoServer (through WFS services).

With this data provider, you can connect your GeoServer Features to React-Admin, to view & edit geospatial data.

Installation

npm install --save ra-data-geoserver

Usage

This data provider requires these parameters:

  • geoserverBaseURL: base url where GeoServer is running (remember to enable CORS)
  • geoserverWorkspace: geoserver workspace where features are published (not support for multiple workspaces)
  • geoserverUser: geoserver user with permissions to access WFS Services
  • geoserverPassword: geoserverUser password
// in src/App.js
import * as React from "react"
import { Admin, Resource } from "react-admin"
import geoServerProvider from "ra-data-geoserver"

const dataProvider = geoServerProvider({
    geoserverBaseURL: "http://localhost:3000/geoserver",
    geoserverWorkspace: "tiger",
    geoserverUser: process.env.REACT_APP_GEOSERVER_USER,
    geoserverPassword: process.env.REACT_APP_GEOSERVER_PASSWORD,
})
import { PoiList } from "./resources/poi"

const App = () => (
    <Admin dataProvider={dataProvider}>
        <Resource name="poi" list={PoiList} />
    </Admin>
)

export default App

An example application is available here

Features

Some features are still in progress:

  • Basic CRUD Features
  • Sorting columns (fid is not supported on GeoServer)
  • Support Point, MultiLineString and MultiPolygon geometries
  • Multiple actions (getMany/getManyReference, updateMany, deleteMany)
  • Custom geometry field name (default 'the_geom')

License

This data provider is licensed under the MIT License