
    DhO              
       &   S SK r S SKrS SKJr  SSKJrJr  S SKJr  S SK	J
r
  \R                  " SS9\R                  " S	5      \R                  " S
5      \R                  " SSSSS9\\R                  \S 5       5       5       5       5       5       5       rg)    N)
use_rs_opt   )obj_geneval_feature_expression)with_context_env)ObjectEncoderz/Calculate GeoJSON property by Python expression)
short_helpproperty_name
expressionz--overwriteTFz$Overwrite properties, default: False)is_flagdefaulthelpc           	         [         R                  " S5      n[        U5      n[        U5       H  u  pxUR	                  S5      =(       d    U/n	[        U	5       H  u  pU(       d!  XS   ;   a  [         R
                  " U S35      e[        X5      US   U'   U(       a  [         R                  " SSS9  [         R                  " [        R                  " U[        S95        M     M     g	)
a  
Create a new property on GeoJSON features using the specified expression.


The expression is evaluated in a restricted namespace containing:
    - sum, pow, min, max and the imported math module
    - shape (optional, imported from shapely.geometry if available)
    - bool, int, str, len, float type conversions
    - f (the feature to be evaluated,
         allows item access via javascript-style dot notation using munch)

The expression will be evaluated for each feature and its
return value will be added to the properties
as the specified property_name. Existing properties will not
be overwritten by default (an Exception is raised).

Example


$ fio cat data.shp | fio calc sumAB  "f.properties.A + f.properties.B"

stdinfeatures
propertiesz8 already exists in properties; rename or use --overwriteF)nl)clsN)clickget_text_streamr   	enumerateget
UsageErrorr   echojsondumpsr   )ctxr
   r   	overwriteuse_rsr   sourceiobjr   jfeats               aC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\fiona/fio/calc.pycalcr'      s    > !!'*EU^FF#77:&/3% *GA|2D!D&&$o &0 0 
 1H1D}- 

6e,JJtzz$M:; + $    )r   r   cligjr   helpersr   r   	fiona.fior   fiona.modelr   commandargumentoptionpass_contextr'    r(   r&   <module>r2      s       5 & % KL mT59;,<   ;  ! M,<r(   