Only one shared model map is required.
Ha, thats easy enough - if one knows how to!
Thank you very much Stu!
Only one shared model map is required.
Ha, thats easy enough - if one knows how to!
Thank you very much Stu!
Hello Stu, can you tell please, what is wrong with my code?
It only generates the standard name objects "pier_2_5", but does not trigger on the individual pier:width
<wayConfiguration>
<selectionCondition expression=" ($pier:width) >= '10'"/>
<defaultModel>
<staticModel name="Piers\Pier_2_5\pier_2_5"/>
</defaultModel>
<virtualObjects>
<spacing min="5.0" max="5.0"/>
<startDistance min="0" max="0"/>
<offSetLeft min="0.0" max="0.0" orientationSense="100"/>
<modelMap>
<staticMapEntry expression="($pier:width == '150')" name="Piers\Pier_1_5\pier_1_5" FORrotationOffSet="0.0"/>
<staticMapEntry expression="($pier:width == '250')" name="Piers\Pier_2_5\pier_2_5" FORrotationOffSet="0.0"/>
<staticMapEntry expression="($pier:width == '300')" name="Piers\Pier_3_0\pier_3_0" FORrotationOffSet="0.0"/>
</modelMap>
</virtualObjects>
</wayConfiguration>
Display More
Hi Thomas
A number of issues here
At first I thought
"Of course, you are not using the operator alias #GE# for >="
The expression engine provides the alias/escape strings for operators to avoid special characters in XML. However >= will actually evaluate correctly.
"<=" will give a syntax error. for consistency it is probably better to always use the alias strings
The (...) construct is intended to define precedence in the expression. The ($pier:width) defeats my variable preload algorithm.
I am parsing the expression into tokens on spaces to pick out variable names to preload before tag data is loaded. This avoids a "variable not defined" exception from the expression engine and allows the sparse tag negation functionality added in 0.7.1
Use $pier:width #GE# '10' or ($pier:width #GE# '10')
That lead me to the core problem. It appears there is a bug in the XSharper engine with comparison of left justified numeric values.
($height #LE# '90') will evaluate true for height tag value '100'
but
($height #LE# ' 90') will evaluate to false
I need to look under the hood of the XSharper engine to see if there is any way to fix this or find a workaround.
/Stu
PS
what tag data are you comparing?
zero padding will work.
'090' will evaluate correctly compared with '100'
where '90' will not.
If you have added these tags using leading zero pad
PPS
turns out XSharper variables were defaulting to string type.
need to detect tag datatype and force a cast to int or float as the variable is set.
Thank you Stu for your commens.
Yes silly from me, not to use #GE# ...
But as this criteria triggers OK for me, the main problem in fact is, that it does not trigger the conditions:
expression="($pier:width == '150')"
etc.
These are my OSM data:
I now tried 0150, but that did not help either:
together with
expression="($pier:width == '0150')"
The LOG looks OK so far, but finally, only the type
<[string8][geometry][..\objects\Piers\Pier_Wood_1_6\pier_wood_1_6]>
is exported.
As I mentioned in the postscript to a previous post, the expression engine did not internally resolve data types of
variables and all variables defaulted to string. So it was doing a string compare for all numeric variables in expressions.
I am testing a fix that loads int or float variables as required.
In the pier example what is the expression in the model map?
sorry I did not scroll down in the include.
Based on the log, the string compare (without leading zero) should have exported 2 different models.
But it is actually exporting <[string8][geometry][..\objects\Piers\Pier_Wood_1_6\pier_wood_1_6]> ???
I don't see where that could possibly come from based on the included config.
"1_6" does not appear anywhere in the config!!!
Yes, what looks like a valid expression is always returning false.
I will have to see if I can reproduce the problem.
Published release 0.7.2 of ObjectGen
Some bug fixes plus intersection exclusion functionality.
Without exclusion collisions are unavoidable.
With exclusion
wait.... I must be stupid but.... does that mean that these cars are not static ??? they move ????
That would be great !
I wish moving traffic was that easy!!!
By "collision" I meant more than one vehicle occupying the same coordinates
Hi!
I 'm looking in vain for OSM data with Windmills but until now no success...
how to do?
thanks for your helps
rakouth
OSM data with Windmills
Do you mean classical wind mills or wind power generators?
Hi! Thomas
I want wind turbine (wind power generators..)
rakouth
I want wind turbine
Hello Rakouth / Gasy24,
The syntax part (taken and modified from the "test" example) you will need is:
<!-- ============================================================================================ -->
<!-- #0.2.3.1 default static model
Expected results:
static windmills
random orientation
-->
<nodeConfiguration>
<selectionCondition expression="($power == 'generator' #AND# $generator:source == 'wind' "/>
<defaultModel>
<staticModel name="windmills/90m/90M"/>
</defaultModel>
</nodeConfiguration>
Display More
This keys also must be contained in the OSM file.
You can check and edit your osm file with JOSM.
It will need two keys/attributes:
power= generator
and
generator:source=wind
I found this example near Schoeppingen in Germany at location
52.0970822, 7.2778395
You may find different definitions, so you have to edit the OSM entry in that case or adapt the xml definitions to the keys found in the OSM file.
Anyhow, they have to match to trigger a find by ObjectGen.
Okay but I'm not familiar with JOSM...
I want something that is ready to convert by ObjectGen as it do with PowerPylons, Storage Tank...
I want something that is ready to convert
you are welcome.
une dernière demande d'aide avant ... abandon à regret !
j'ai créé la couverture générale de la Corse (en 2 maps) avec PylonGen ... génial, ok du premier coup.
J'ai ensuite voulu tenter de placer un seul pylône de Communication/TV en utilisant un fichier .tsc modifié pour test ...
Impossible d'obtenir un affichage après plusieurs jour d'essai divers ...
Le pylonesTV est dans un répertoire "com_tower_models" situé dans le même répertoire que le fichiers pigno2_tv.tsc
Quelqu'un peut-il me dire ce qui est faux dans mon fichier pigno2_tv.tsc joint. Je n'ai pas de fichier .toc puisque PylonGen n'en produisait pas et que cela marchait sans.
Merci pour votre aide.
À la première vue, ce sont surtout les deux signes ">" qui déranges:
Un autre point: le code ICAO doit être unique, sinon le fichier est ignoré. Comme il ne s’agit pas d’un aérodrome, il est préférable de laisser le code ICAO vide.
De manière générale, il est préférable de mettre tous les objets dans un seul fichier * .tsc, dans la mesure où la distance le permet.
Essayez le fichier modifié: pigno2_tv (1)_mod.txt
Regards,
Christophe