So here is my problem. I plan to implement a localized map for my college presenting all the locations such as main block, Tech park etc. Not only do i plan to develop a GUI but also I also want to run my own algorithms, such as finding the quickest route from one block to another etc (Note: the algorithm is something i will be writing since i don't want to take the shortest route as the quickest but want to add my own parameters as weights). I want to host the map locally (say on a in house system) and should be able to cater real time request (displaying route to the nearest cafeteria) and display current data (such as what event is taking place in what corner of the campus). I know Google Maps API or Openstreetmap/OpenLyers API will enable me to build my own map, but can i run my own algorithms on them? also can I add elements that i have created and replace the traditional building/office components with my own?
You can do the following :
1. Export a part of open street map from their website. (go to the export tab)
2. Use ElementTree in python to parse the exported the xml data.
3. Use networkx to add the parsed data into a graph.
4. Run your algorithms on it.
Related
I know how to use input widget in Slate but I have a use case where I need to create several inputs from an array. Maybe one, maybe more, let's say around 10 or 15. Is that possible to create a input and to catch the user entry just by using an HTML widget.
One other way to say shoud be: I would like to have a table of 1 to 15 rows with one column dedicated to an input area. Number of row depend of the source data, so I want that the input is created dynamically. Is it possible in foundry-slate ?
Best regards
You can't do this in a plain HTML widget - the dependency graph can't read state from arbitrary HTML input elements.
There are a couple other options here; the one that most directly works they way you would like it to in your question, would be to use the Code Sandbox widget, which effectively let's you build your own widget and wire it up to the Slate dependency graph for interaction with the rest of the app. You can use a 3rd-party library, assuming you have the license, to do something more advanced (you can search your Foundry instance for some examples in the Slate Reference Examples) or simply use HTML and Javascript to build the widget as you would in normal web development as you have access to the DOM and JQuery when working in the Sandbox.
Slightly more in-line with how Slate might expect you to build this functionality, you can use a single input widget, but toggle what you do with the associated input based on other state, for example what row the user has selected. This, in combination with a button that stores the input into a Variable with a click event, can be used to let users build up a "bag" of edits, that you can then apply with Actions (or you can apply them immediately - all depends on the workflow). You'll find some examples of that pattern in the "Events" folder in the Slate Reference Examples.
Thinking a bit more expansively, if you model your data in the ontology, you can set up an editable table pattern in Workshop and have a quite straightforward experience once you have the right Action and Object Type configuration. You'll find the documentation on this on your Foundry instance at https://www.palantir.com/docs/foundry/workshop/widgets-object-table/#inline-edits-or-cell-level-writeback and an example in the Flight Alert Inbox example application.
for Forge Autodesk.AEC.LevelsExtension, where is the cut plane? looks like it doesn't follow the view range in Revit?
Appended to what Cyrille mentioned.
Revit's AEC model data will be generated automatically during the Forge translation. The level info is dumping from Revit Level elements, e.g., the name, guid, elevations, extensions of the Revit Level which you can see with Revit API. The Levels extension just uses it to rebuild level ranges.
For example, the cutting range of level 1 will be from level1's elevation to (level2's elevation - a height adjustment) with my research. The height adjustment is to avoid cutting on top of floors to brining a better view. So, it's not following Revit's view range of the floor plan view.
If the levels extension doesn't match your need, you may check out my level section tool. This sample demonstrates the concept of how to create cut planes by levels.
In this extension, floors cut planes are defined based on the bounding box of the floor node in the scene instance tree. Floors are defined in an additional AEC data json file which contains additional information.
I want to use the ModelStructurePanel in my Forge Viewer to show the user a list of models and they can choose which model is to be loaded or unloaded, but (even after they are unloaded) i need the models to still show up in the model browser.
Basically i want the usual behavior of the ModelStructurePanel when multiple models are loaded, but i want to override it in a way i can use it to display multiple models before loading them through user input.
Once a model is loaded, all the functionalities of the ModelStructurePanel should work the same.
Is this possible to implement?
Your approach seems a bit convoluted, I see 2 ways you could get job done:
1/ You can have a custom control (treeview or list for instance) that only displays your models, so user can pick one and it gets loaded by the viewer, then it loads model structure in the built-in panel
2/ You create a custom instanceTree which represent your models (but it has to mimic the Forge instanceTree) and you pass it to the built-in modelstructure so it shows your models hierarchy, then user can pick one and it will load in viewer, at which point you load the current model tree inside the panel. Loading data in the modelstructure can be done with:
viewer.modelstructure.setModel(instanceTree);
Personally I would go with approach 1/, as you could customize better your own control rather than fiddling around with the modelstructure which is not designed for that purpose
As the title says I am looking to use the Design Automation API to upload an archive of blocks, then insert them all into a drawing with a border.
The positioning of the blocks does not matter they just need to be inserted into the drawing ready to be arranged by an engineer.
Any help or advice on end points or limitations would be great thanks.
This is doable. You need to develop a custom activity with 2 inputs and one output. input#1 is the base drawing with boarder and input#2 is a zip file with the blocks. When you submit your workitem you will mark the second input argument as ResourceKind = ResourceKind.ZipPackage this will tell the service that it should unzip the file into the folder designated by LocalFileName. Then your script can enumerate the files in the folder (see vl-directory-files) and issue the INSERT command.
Attempting to extract the data from this Google Politics Insights webpage from "Jan-2012 to the Present" for Mitt Romney and Barack Obama for the following datasets:
Search Trends Based on volume
Google News Mentions Mentions in articles and blog posts
YouTube Video Views Views from candidate channels
For visual example, here's what I mean:
Using Firebug I was able to figure out the data is stored in a format readable by Raphael 2.1.0; looked at the dataset and nothing strikes me as a simple way to convert the data to CSV.
How do I convert the data per chart per presidential candidate into a CSV that has a table for "Search Trends", "Google News Mentions", and "YouTube Video Views" broken down by the smallest increment of time with the results measured in the graph are set to a value of "0.0 to 1.0"? (Note: The reason for "0.0 to 1.0" is the graphs do not appear to give volume info, so the volume is relative to the height of the graph itself.)
Alternatively, if there's another source for all three datasets in CSV, that would work too.
First thing to do is to find out where the data comes from, so I looked up the network traffic in my developer console, and found it very soon: The data is stored as json here.
Now you've got plenty of data for each candidate. I don't know exactly in what relation these numbers are but they definitely are used for their calulation in the graph. I found out that the position in the main.js is on line 392 where they calculate the data with this expression:
Math.log(dataPoints[i][j] * 100.0) / Math.log(logScaleBase);
My guess is: Without the logarithm and a bit exponential calculation you should get the right results.