Tool for editing field spatial layout using GeoJson information.
- BrAPI v2 server
- @solgenomics/brapijs
- D3.js (v4)
- Leaflet
- Leaflet.Editable
- Leaflet.Path.Transform
Specify a BrAPI endpoint and studyDbId to get the plot information. If the study observationUnits have geoJson information, it will draw them in the map. If they don't have it, you need to select an area over the map to draw the plots based on other field layout information (e.g X/Y row-col design). Left-click over plots to resize, move or rotate the entire layout. Right-click to edit individual plots.
These configuration options are available. To see all available options look at DEFAULT_OPTS in src/Fieldmap.js. Usage:
var fieldMap = new BrAPIFieldmap("#map", brapi_endpoint, {plotLength: 10});
// or after construction
fieldMap.brapi_endpoint = d3.select('#endpoint').node().value;
fieldMap.opts.plotLength = d3.select('#length').node().value;
fieldMap.opts.plotWidth = d3.select('#width').node().value;
option | description | default value |
---|---|---|
brapi_auth | brapi token passed to brapi.js | null |
brapi_pageSize | 1000 | |
defaultPos | Default map position | [0,0] (World map) |
defaultZoom | Default map zoom | 2 |
normalZoom | zoom used for normal operations (set location, search location) | 16 |
plotWidth | (derived from polygon) | |
plotLength | (derived from polygon) | |
plotScaleFactor | scale to shrink final plot grid | 1 |
style | Leaflet geoJson style | |
useGeoJson | if true, BrAPI geoCoordinates (geoJson) will be used to draw the layout, else X,Y coordinates will be used | true |
method | description |
---|---|
load(studyDbId) |
Load plots from study. Return promise |
setLocation(studyDbId) |
Position the map using study location coordinates. Return promise |
update() |
Send geoCoordindates to server (using brapi PUT /observationunits ). Return promise |
- Extract common modules with Brapi-HeatMap?
- Edit individual plots
- Add search location input
- Add option to specify plot length/width
- Implement ImageOverlay to allow a mix of real field images (aerial or drones) with map tiles layer.
- Automated tests
- Add plots to existing layout
- "Buffer" zones / empty space between plots
- Bulk plot edition (select multiple plots and rearrange them)
Nahuel Soldevilla [email protected]
Inspired by and based on BrAPI-HeatMap. Developed at the Boyce Thompson Institute with the help of Mirella Flores, in collaboration with Integrated Breeding Platform.