netlogo, gis extension not drawing and giving an error - netlogo

I am trying to draw a few gis files using netlogo. I have 3 shape files (area boundary, building polygons & road network).
When I use the gis:draw command one of the files draws perfectly (area boundary) but with the other 2 shape files. One doesn't draw at all (road network) and other gives the following error "unsupported shape type 15 error while observer running GIS:LOAD_DATASET"
The largest file size is 1927KB
Any ideas why?

Related

Create/export x,y,z coordinates of roads from a shp file in QGIS: how to get the endnodes of road network?

In relation to What is the way to create/export x,y,z coordinates of roads from a shp file in QGIS?, and in particular, to:
(1) Try using the Extract Vertices tool (QGIS Version 3.20.2). This may be called Extract Nodes in previous versions.
(2) Once you have the output from the nodes, you can use Add Coordinates to Points to get the X, Y, and Z values.
I got the Vertices, and I am trying to get "Add coordinates to points" (I got some issues/errors with SAGA, and then I installed SAGA Next Gen, which looks like working, even though it takes a lot of time!)
Now, how can I get just the endnodes of the TLM3D road network and not all the vertices of TLM3D?
EDIT:
The part about "Add coordinates to points" did not finish and I got this error:
C:\Users\los\Desktop>exit
Execution completed in 2446.05 seconds (40 minutes 46 seconds)
Results:
{'OUTPUT': 'C:/Users/los/AppData/Local/Temp/processing_zCjQzI/c11c256eed374e348c4b4664cd4881f7/OUTPUT.shp'}
Loading resulting layers The foll owing layers were not correctly generated.
C:/Users/los/AppData/Local/Temp/processing_zCjQzI/c11c256eed374e348c4b4664cd4881f7/OUTPUT.shp
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

Visualising road segments as heatmap in Leaflet efficiently

I have data consisting of parts of road segments of a city, with different number of visits. I want to plot the data on a Map and visualise it in the form of a heatmap.
I have two related questions:
I have the data from Open Street Maps (OSM) in the form of pairs of node ID's, where node ID correspond to the unique ID being assigned to a point by OSM. I also have a mapping for each node Id to its corresponding coordinates. Is there any Leaflet or Mapbox utility or plugin, which can plot a trip / highlight the road segment using 2 node ID's. I can always do it manually (by using the coordinate mapping and converting it into GeoJSON), but the problem occurs with the line width -- I have to make it exactly overlap with the width of the road, so that it seems that I am highlighting a road segment.
Is there any plugin / utility for Leaflet or Mapbox, which can be used for plotting polylines or geojson as heatmap efficiently? My current approach is calculating the color for each polyline and encoding that as a geojson property. But the problem is that with the increase in the number of lines (> 1K) the rendering becomes a pain and the method is not feasible. There are some plugins for Leaflet out there for plotting heatmap, but all of them are for points only and not lines. Any approach using WebGL would be really great.
An approach which I thought of could be converting my data into a shape file, upload to Mapbox Studio and use as a layer directly. But I have no idea how to go about doing that i.e. creating a shapes file, encoding the information in such a way that the complete road segment gets highlighted in the correct color.

How to make Folium's Heatmap weights not be influenced by the number of points in a region?

I'm trying to build a home value Heat Map for a city using Folium (a python library that uses Leaflet to plot geo data). My Dataframe contains Latitude, Longitude, and Price (variable which is going to act as weight). Cheap areas should be green and expensive, red. The problem is that some poor regions with many dots seem to be more expensive, because those dots overlay each other and turn that region red. The method has some parameters to switch, but any of them solved my problem. Does anyone have a way to overcome this or an alternative library to make interactive heat maps using python?

Obtain shape data from 3D extracted region in MATLAB

I am attempting to isolate the shape of a cow in an image. The image is captured using a modified kinect camera. Below is the stage I have got to so far, showing what is left after I have deleted all non-required parts of the image. (The image shows the torso of a cow, viewed from above with the head of the animal on the left).
This was done by deleting all the pixels that were furthest away from the camera (the floor) and then isolating the region that can be seen below.
I am struggling to obtain useful data about this shape. Ideally, I would like to obtain the perimeter, area and major axis. If anyone can help I would be very grateful.
The end goal is to be able to detect a 'cow shape' and then I can move onto the next phase which is to ID each animal.

MATLAB image processing of small circles

I have an image which looks like this:
I have a task in which I should circle all the bottles around their opening. I created a simple algorithm and started working it. My algorithm follows:
Threshold the original image
Do some morphological opening in it
Fill the empty holes
Separate the portion of the image using region props such that only the area equivalent to the mouth of the bottles is selected.
Find the centroid for each and draw circle around each bottle.
I did according to the algorithm above and but I have some portion of the image around which I draw a circle. This is because I have selected the area since the area of the mouth of bottle and the remained noise is almost same. And so I yielded a figure like this.
The processing applied on the image look like this:
And my final image after plotting the circle over the original image is like this:
I think I can deal with the extra circle, that is, because of some white portion of the image remained as shown in the figure 2 below. This can be filtered out using regionproping for eccentricity. Is that a good idea or there are some other approaches to this? How would I deal with other bottles behind the glass and select them?
Nice example images you provide for your question!
One thing you can use to detect the remaining bottles (if there are any) is the well defined structure of the placement of the bottles.
The 4 by 5 grid of the bottle should be relatively easy to locate, and when the grid is located you can test if a bottle is detected at each expected bottle location.
With respect to the extra detected bottle, you can use shape features like
eccentricity,
the first Hu moment
a ratio between the perimeter length squared over the area (which is minimized for a circle) details here
If you are able to detect the grid, it should be easy to located it as an outlier (far from an expected bottle location) and discard accordingly.
Good luck with your project!
I've used the same approach as midtiby's third suggestion using the ratio between area and perimeter called shape factor:
4π * Area /perimeter^2
to detect circles from a contour traced image (from the thresholded image) to great success;
http://www.empix.com/NE%20HELP/functions/glossary/morphometric_param.htm
Regarding the 4 unfound bottles, this is rather tricky without some a priori knowledge of what it is you're looking at (as discussed using the 4 x 5 grid, then looking from the centre of each cell). I did think that from the list of contours, most would be of the bottle tops (which you can test using the shape factor stuff), however, one would be of a large rectangle. If you could find the extremities of the rectangle (from the largest contour in terms of area), then remove it from the third image, you'd be left with partial circles. If you then contour traced those partial circles and used a mixture of shape factor/curve detection etc. may help? And yes, good luck again!