Re: [Arches] Re: Converting WKT to GeoJSON to sort geometries by type

2016-06-06 Thread Adam Cox
Aha, that is more concise than what I ended up with. I didn't think to look
for built-in Django functions. Thanks!

Adam

On Mon, Jun 6, 2016 at 2:46 PM, Rob Gaston  wrote:

> Hi Adam,
>
> Arches includes all the tools you need to do this conversion on either the
> client or server.
>
> I've created a gist here
>  with
> a python file showing how to do it on the server and a javascript file
> showing how to do it on client.
>
> Let me know if you have questions about it.
>
> Hope that helps!
> - Rob
>
> On Wednesday, June 1, 2016 at 9:43:29 AM UTC-7, Adam Cox wrote:
>>
>> I'm recording different types of geometry for a given resource (Project
>> Area vs. Area of Potential Effect, in this case), and would like a little
>> feedback on the following methodology, if anyone has any.
>>
>> For background, a simple v3 resource with one polygon looks like this in
>> its raw json form:
>>
>> {
>>   "_index": "resource",
>>   "_version": 5,
>>   "typename": "Management Activity (A)",
>>   "source": {
>> "geometry": {
>>   "type": "GeometryCollection",
>>   "geometries": [
>> {
>>   "type": "Polygon",
>>   "coordinates": [
>> [
>>   [
>> -77.01996456234521,
>> 38.93674344318805
>>   ],
>>   [
>> -77.01708923428123,
>> 38.93480730232329
>>   ],
>>   [
>> -77.01309810726707,
>> 38.9378116362102
>>   ],
>>   [
>> -77.0173896416909,
>> 38.93897995390404
>>   ],
>>   [
>> -77.01932504997106,
>> 38.93729891398618
>>   ],
>>   [
>> -77.01996456234521,
>> 38.93674344318805
>>   ]
>> ]
>>   ]
>> },
>>   ]
>> },
>> "graph": {
>>   "PLACE_E53": [
>> {
>>   "SPATIAL_COORDINATES_GEOMETRY_E47": [
>> {
>>   "ACTIVITY_GEOMETRY_TYPE_E55__label": "Project Area",
>>   "ACTIVITY_GEOMETRY_TYPE_E55__value": "Project Area",
>>   "SPATIAL_COORDINATES_GEOMETRY_E47__value": "POLYGON
>> ((-77.0199645623452080 38.9367434431880500, -77.0170892342812290
>> 38.9348073023232930, -77.0130981072670690 38.9378116362101990,
>> -77.0173896416908970 38.9389799539040380, -77.0193250499710590
>> 38.9372989139861830, -77.0199645623452080 38.9367434431880500))",
>>   "SPATIAL_COORDINATES_GEOMETRY_E47__label": "POLYGON
>> ((-77.0199645623452080 38.9367434431880500, -77.0170892342812290
>> 38.9348073023232930, -77.0130981072670690 38.9378116362101990,
>> -77.0173896416908970 38.9389799539040380, -77.0193250499710590
>> 38.9372989139861830, -77.0199645623452080 38.9367434431880500))"
>> }
>>   ]
>> },
>>   ]
>> },
>> "value": "",
>> "label": "",
>> "primaryname": "Unnamed Resource",
>> "child_entities": [],
>> "entitytypeid": "ACTIVITY_A.E7",
>> "entityid": "37b91e97-bb78-4dee-864b-c493052151c9",
>> "property": "",
>> "businesstablename": ""
>>   },
>>   "found": true,
>>   "_id": "37b91e97-bb78-4dee-864b-c493052151c9",
>>   "type": "ACTIVITY_A.E7"
>> }
>>
>> As you can see, a single geometry is stored in two separate places, once
>> in this list, resource["source"]["geometry"] (which is stored in
>> GeoJSON) and once within the full graph structure,
>> resource["graph"]["PLACE_E53"]["SPATIAL_COORDINATES_E47"][
>> "SPATIAL_COORDINATES_GEOMETRY_E47__value"] (which is stored in WKT).  In
>> all mapped representations of the resource, the GeoJSON is used.  However,
>> the geometry type that is stored in the graph, in this case, "Project Area"
>> (but in Arches-HIP this could be "vicinity point",or "perimeter polygon")
>> is completely lost in the GeoJSON representation.
>>
>> I'd like to show Project Areas and Areas of Potential Effect in different
>> colors.  To do so, I'll sort through the resource graph and create new
>> geometry collections.  Thing is, I'll need to convert these geometries from
>> the graph WKT to GeoJSON. I've found a couple of methods for this
>> https://gist.github.com/drmalex07/5a54fc4f1db06a66679e and
>> https://github.com/larsbutler/geomet.
>>
>> I'm wondering if anyone has any thoughts on this, or whether this
>> conversion is handled in a different manner elsewhere in the Arches app?
>> If not, were there ever plans in Arches-HIP to display the difference
>> between (for example) a vicinity point and an access point?
>>
>> Adam
>>
>>
>>
>> --
> -- To post, send email to archesproject@googlegroups.com. To unsubscribe,
> send email to archesproject+unsubscr...@googlegroups.com. For more
> information, visit https://groups.google.com/d/forum/archesproject?hl=en
> ---
> You received this 

[Arches] Re: Converting WKT to GeoJSON to sort geometries by type

2016-06-06 Thread Rob Gaston
Hi Adam,

Arches includes all the tools you need to do this conversion on either the 
client or server.

I've created a gist here 
 with a 
python file showing how to do it on the server and a javascript file 
showing how to do it on client.

Let me know if you have questions about it.

Hope that helps!
- Rob

On Wednesday, June 1, 2016 at 9:43:29 AM UTC-7, Adam Cox wrote:
>
> I'm recording different types of geometry for a given resource (Project 
> Area vs. Area of Potential Effect, in this case), and would like a little 
> feedback on the following methodology, if anyone has any.
>
> For background, a simple v3 resource with one polygon looks like this in 
> its raw json form:
>
> {
>   "_index": "resource",
>   "_version": 5,
>   "typename": "Management Activity (A)",
>   "source": {
> "geometry": {
>   "type": "GeometryCollection",
>   "geometries": [
> {
>   "type": "Polygon",
>   "coordinates": [
> [
>   [
> -77.01996456234521,
> 38.93674344318805
>   ],
>   [
> -77.01708923428123,
> 38.93480730232329
>   ],
>   [
> -77.01309810726707,
> 38.9378116362102
>   ],
>   [
> -77.0173896416909,
> 38.93897995390404
>   ],
>   [
> -77.01932504997106,
> 38.93729891398618
>   ],
>   [
> -77.01996456234521,
> 38.93674344318805
>   ]
> ]
>   ]
> },
>   ]
> },
> "graph": {
>   "PLACE_E53": [
> {
>   "SPATIAL_COORDINATES_GEOMETRY_E47": [
> {
>   "ACTIVITY_GEOMETRY_TYPE_E55__label": "Project Area",
>   "ACTIVITY_GEOMETRY_TYPE_E55__value": "Project Area",
>   "SPATIAL_COORDINATES_GEOMETRY_E47__value": "POLYGON 
> ((-77.0199645623452080 38.9367434431880500, -77.0170892342812290 
> 38.9348073023232930, -77.0130981072670690 38.9378116362101990, 
> -77.0173896416908970 38.9389799539040380, -77.0193250499710590 
> 38.9372989139861830, -77.0199645623452080 38.9367434431880500))",
>   "SPATIAL_COORDINATES_GEOMETRY_E47__label": "POLYGON 
> ((-77.0199645623452080 38.9367434431880500, -77.0170892342812290 
> 38.9348073023232930, -77.0130981072670690 38.9378116362101990, 
> -77.0173896416908970 38.9389799539040380, -77.0193250499710590 
> 38.9372989139861830, -77.0199645623452080 38.9367434431880500))"
> }
>   ]
> },
>   ]
> },
> "value": "",
> "label": "",
> "primaryname": "Unnamed Resource",
> "child_entities": [],
> "entitytypeid": "ACTIVITY_A.E7",
> "entityid": "37b91e97-bb78-4dee-864b-c493052151c9",
> "property": "",
> "businesstablename": ""
>   },
>   "found": true,
>   "_id": "37b91e97-bb78-4dee-864b-c493052151c9",
>   "type": "ACTIVITY_A.E7"
> }
>
> As you can see, a single geometry is stored in two separate places, once 
> in this list, resource["source"]["geometry"] (which is stored in GeoJSON) 
> and once within the full graph structure, 
> resource["graph"]["PLACE_E53"]["SPATIAL_COORDINATES_E47"][
> "SPATIAL_COORDINATES_GEOMETRY_E47__value"] (which is stored in WKT).  In 
> all mapped representations of the resource, the GeoJSON is used.  However, 
> the geometry type that is stored in the graph, in this case, "Project Area" 
> (but in Arches-HIP this could be "vicinity point",or "perimeter polygon") 
> is completely lost in the GeoJSON representation.
>
> I'd like to show Project Areas and Areas of Potential Effect in different 
> colors.  To do so, I'll sort through the resource graph and create new 
> geometry collections.  Thing is, I'll need to convert these geometries from 
> the graph WKT to GeoJSON. I've found a couple of methods for this 
> https://gist.github.com/drmalex07/5a54fc4f1db06a66679e and 
> https://github.com/larsbutler/geomet.
>
> I'm wondering if anyone has any thoughts on this, or whether this 
> conversion is handled in a different manner elsewhere in the Arches app? 
>  If not, were there ever plans in Arches-HIP to display the difference 
> between (for example) a vicinity point and an access point?
>
> Adam
>
>
>
>

-- 
-- To post, send email to archesproject@googlegroups.com. To unsubscribe, send 
email to archesproject+unsubscr...@googlegroups.com. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to archesproject+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Arches] Re: Accessing languages via Django

2016-06-06 Thread Adam Cox
You're correct, that's not what I was thinking. I know that Arches/Django
does support multiple languages for the app's interface, but I haven't
explored this option myself yet.  I'll be interested to know what you find,
and if I can look into it soon I'll let you know.

Adam

On Mon, Jun 6, 2016 at 8:12 AM,  wrote:

> I am not sure I explained myself correctly Adam. Let me try again: we have
> translated our entire platform in Arabic, including both the static strings
> which Django reads via the .mo file and our nodes and concepts. The
> translations for the latter two have been entered via the RDM as altLabels
> selecting Arabic as a language. Arabic had been previously added as a
> language via the Django admin panel (Models -> d_languages).
>
> Now, what I want to do is to be able to select the appropriate app
> language in the header dropdown so that, when I select Arabic, I get the
> whole app to be shown in Arabic. Do I have to write this whole class from
> scratch? Or does something exist already to support multilingual apps?
>
> Andrea
>
>
> On Wednesday, June 1, 2016 at 10:38:48 PM UTC+1, Adam Cox wrote:
>>
>> Hi Andrea, technically this is possible, but I don't think it would do
>> what you are hoping... The Languages dropdown is meant to be configured to
>> allow the user to change the app's interface language, while the language
>> concepts are only meant to be attributes for a resource (the language that
>> an Information Resource is written in, for example).
>>
>> Adam
>>
>> On Wednesday, May 25, 2016 at 12:59:08 AM UTC-6, zerbini...@gmail.com
>> wrote:
>>>
>>> Hi All,
>>>
>>> I am in need to change the static 'Languages' dropdown menu in the
>>> header.htm template to a dynamic one looping through the list of languages
>>> in the concepts.d_languages table. Has someone already written this code ?
>>> I couldn't figure out how to read the language table via Django tags.
>>>
>>> Best,
>>>
>>> Andrea
>>>
>> --
> -- To post, send email to archesproject@googlegroups.com. To unsubscribe,
> send email to archesproject+unsubscr...@googlegroups.com. For more
> information, visit https://groups.google.com/d/forum/archesproject?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Arches Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to archesproject+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- To post, send email to archesproject@googlegroups.com. To unsubscribe, send 
email to archesproject+unsubscr...@googlegroups.com. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to archesproject+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Arches] Re: Accessing languages via Django

2016-06-06 Thread zerbini . eamena
I am not sure I explained myself correctly Adam. Let me try again: we have 
translated our entire platform in Arabic, including both the static strings 
which Django reads via the .mo file and our nodes and concepts. The 
translations for the latter two have been entered via the RDM as altLabels 
selecting Arabic as a language. Arabic had been previously added as a 
language via the Django admin panel (Models -> d_languages).

Now, what I want to do is to be able to select the appropriate app language 
in the header dropdown so that, when I select Arabic, I get the whole app 
to be shown in Arabic. Do I have to write this whole class from scratch? Or 
does something exist already to support multilingual apps?

Andrea

On Wednesday, June 1, 2016 at 10:38:48 PM UTC+1, Adam Cox wrote:
>
> Hi Andrea, technically this is possible, but I don't think it would do 
> what you are hoping... The Languages dropdown is meant to be configured to 
> allow the user to change the app's interface language, while the language 
> concepts are only meant to be attributes for a resource (the language that 
> an Information Resource is written in, for example).
>
> Adam
>
> On Wednesday, May 25, 2016 at 12:59:08 AM UTC-6, zerbini...@gmail.com 
> wrote:
>>
>> Hi All,
>>
>> I am in need to change the static 'Languages' dropdown menu in the 
>> header.htm template to a dynamic one looping through the list of languages 
>> in the concepts.d_languages table. Has someone already written this code ? 
>> I couldn't figure out how to read the language table via Django tags. 
>>
>> Best,
>>
>> Andrea
>>
>

-- 
-- To post, send email to archesproject@googlegroups.com. To unsubscribe, send 
email to archesproject+unsubscr...@googlegroups.com. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to archesproject+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.