Styling vectors based on external configuration using OpenLayers - openlayers-3

How would one go about styling vector features based on a configuration file loaded by an application? Using functions for selecting features based on a property to be styled is problematic as one is required to create functions at run time. Any suggestions on how this can be achieved would be appreciated.

Related

Functions for the Following GIMP Functionality

I'm making my first foray into GIMP scripting (hopefully in Python, but I'm open to Scheme too). I know exactly the steps I want to take using the GIMP UI, and I'm trying to determine which, if any, of the steps can be executed from a script, since the documentation I found suggested that not all functionality can be accessed in this way. Looking at the documentation helped with some, but not all, of what I'm looking for, so I'm hoping for a pointer as to which of the following functionality I can access from Python, and what function I will need, since my googling as come up short.
new layer
new layer from visible
duplicate layer
changing mode to overlay/grain extract/grain merge
gaussian blur
merge layer down
desaturate (lightness)
adjust color curves
filling a transparent layer with the paper pattern
adjust opacity
Open the Python console (Filters>Python-fu>Console).
Hit the Browse... button
Enter what you look for in the top bar on the left (for instance "desaturate")
Select the call in the list below the search filter and see the doc on the right
This includes any callable installed script/plugin (if the authors did their homework). "Apply" copies a call template in the Python console.
You can do more in Python than in Scheme.
The doc for the Python classes is here. The more frequent API calls have corresponding methods/attributes.
If you are on Windows, some tricks to ease your debugging here.
There is not always a direct mapping between UI actions and the API. Some UI actions may correspond to several API calls.
In Gimp 2.10, the GEGL filters aren't callable from Python (at least via the regular Gimp API), unless they replace an existing 2.8 filter (like the Gaussian blur).

I have a .osm file, don't know what to do next?

I created an indoor map file in JOSM, with different levels and tags for each room etc. Now I have it as a .osm file. How do I make it operational. Like how do I deploy it so that it can be used for indoor navigation. I also need some other features like calculating path from one place t other and search index.
You are basically searching for an offline routing and map drawing solution. This has already been answered multiple times. You could even use a full-featured offline solution such as OsmAnd if you convert your map into a suitable format with the OsmAndMapCreator.
So I figured out a way by converting the given .osm file of my indoor map to GeoJSON using OSM2GEOJSON and then displaying that in awesome leaflet library. It's optimized for phones too. Displaying the map in leaflet was a sort of a hefty task but there are lot of plugins and forum answers that helped me. Reading geojson using ajax in leaflet and creating seperate layers for each floors,filtering those geojson layers based on there features.properties.level and then adding leaflet easy-buttons to display each layer. There are also other plugins which can help.

Import/export or store/restore xShapes in LibreOffice/OpenOffice Draw via API

I want – as the title says – extract programmatically a shape from a Draw document through the api interface. Beside I want to import such a shape into a document as well.
I saw some predefined shapes in XML form and the document is stored as XML structure as well. Is there a known way to anybody out there to allow the storage and load of one shape?
What is this good for?
I want to, for example, enable the programmatic deletion of objects. But to enable the undo/redo functionalities I need to “store” the deleted shape. Beyond that this would allow me to add user-defined objects programmatically, e.g. arrow heads, UML structures or unicorns.
Thanks in advance for any ideas,
J
P.S.: I work with LibreOffice Version: 5.2.1.2 . Access the interface through C# (so java and C++ would do it as well) but any ideas are welcome.
I'm not entirely sure what you are trying to do, but here are some ideas:
Instead of deleting an XShape, you could use the dispatcher to Cut it. That will store it in the clipboard, so if it needs to be added back then the dispatcher can Paste it, as long as no other copy or cut was performed.
To create a shape, see the example at https://wiki.openoffice.org/wiki/Documentation/DevGuide/Drawings/Shapes. This code will look different depending on what kind of shape it is. It sounds like you are asking for one code listing that will programmatically create any type of shape, but I do not think it is that easy.
Instead of using the UNO API, you could programmatically modify the XML files, which may make it easier to store and work with any shape. Be sure to use an XML parsing library, not just regular expressions.

How to implement a user definable interactive map in Delphi 2010?

I'd like to have an interactive floor map (so they're not huge) in my application. The maps will be different for every user, but contain similar elements which only differ by quantity and location. The application will show the map, identify certain elements and link them to information from the database.
To design and store the map, I'd rather not roll my own editor and/or come up with some custom file format. However, it would be nice if the format were open and easily readable. SVG seems to be the perfect candidate for the job. All there needs to be is a convention of how to name the elements to make them identifiable. But how to go from there? I need something that can render the SVG and distinguish between the different layers.
TSVG can do exactly this but depends on FireMonkey which I'd rather avoid - it's not even present in Delphi 2010, so I'd have to use another version and do DLL tricks.
Another option would be to use the Chromium Embedded Framework and create the map using HTML, CSS and JavaScript. That feels very bulky, and would be hard to get right.
Are there any simpler ways to do this that I overlooked, either using SVG or perhaps something completely different?
I'm not sure if a GIS system is appropriate for this. It may very well be overkill.
In the end I decided to go for D3.js using Chromium Embedded, to have a flexible and more portable solution.

Rendering UIs / Generating GSPs directly from pencil or balsamiq wireframes

Are there any existing tools/combination-of-tools I can use so that my wireframes built using pencil or balsamiq can be directly used by my application (grails) for rendering the UI? Or maybe a way to generate GSP's out of my wireframes (assuming there is a set style guide etc.)? I am essentially looking to do away with having to code the HTML/GSP for each and every page.
Napkee is a commercial solution. I don't know any completely free one, though

Resources