Welcome to Knowage Q&A, where you can ask questions and receive answers from other members of the community.
0 votes
1 view
I have read the Knowage-CE thoroughly. It seems that many of the screen shots do not correspond to the newest product. I am trying to create a geo map document but cannot figure out how to do it. Do I need to supply my own Svg or layers or do defaults come with CE?

I have also watched all of the online demo materials, and some things on YouTube. Is there other documentation that I can find anywhere?
in Document Browser by (590 points)

2 Answers

0 votes
Hi,

   the ufficial document released about Knowage is available at http://forge.ow2.org/projects/knowage.

The engine that you need is the KnowgeSVGViewerEngine. As you can read you have to:

- define a svg into the catalog

- define a dataset

- define a template with the previous information

Regards.
by (4.4k points)
what does "define an svg into the catalog" mean? where do i get svg documents? do they come with knowage or do i need to find or buy my own?
Hi,
   first of all you have to looking for the svg file: you could create a new one or download it...there are some tools that can help you to convert different format into svg (for example you could use a Gis server like GeoServer to convert shape files into SVG)... depends from the project context.

When you got this file, is necessary insert it into the Knowage SVG catalog..so that the system can use it.
Thank you for this information.

I now have an SVG file, but there don't seem to be any FEATURE DETAIL in the file. the entries look like this:
    <g>
        <path id="US-AK" title="Alaska" class="land" d="M456.18,521.82l-0.1, ... ,731.03z"/>
        </g>

Knowage will not let me add feature definitions for this file. I see on the github site that in the knowage georeportengine/resources directory there is a usa_state.json file and it has features defined in it. can I somehow just import this?

Also, just as a note, in the documentation there are some confusing spelling errors (TRESHOLD for instance) and the XML code is invalid (missing / on end tags).
Hi,
  thank you for the notes about the documentation content, we'll check it (but why TRESHOLD isn't correct?? :) )

Anyway, is correct that the GUI shows as read-only the svg layers (tag <g>). Infact the system reads the file and creates  a new feature (layer) for each one. Pay attention that the system considers only the first level tag, so if you have deeper groups they aren't considered.

You should be able to convert the geojson file into a svg through some tools like GeoServer, but I suggest you to check the final structure and eventually make some change about the groups definition (as I just told you).

The documentation about it is available at chapter "4.14: My first SVG Map or design".. but you should already know it :)
I think in Italian, it is TRESHOLD, so I mean no disrespect! But in your documentation in the Advanced section under "Tags" it is spelled THRESHOLDS :-)

I think I understand. My file has a single <g> tag with no id attribute, and it is followed by 50 states:
<g>
    <path id="US-AK" title="Alaska" class="land" d=.../>
    ...
</g>

so, if I just add <g id="state_borders"> and reload the SVG file, then that will become a FEATURE?
and furthermore, I can add new layers (like id="postal_code_borders") using the same technique?

i will try the json to svg conversion that you mentioned.

thank you so much for your patience. i apologize for my questions.
I think I am close, but I am getting a syntax error when loading my template file. do you have an example map template that I can refer to? I have searched github but cannot find one. I think I may be misunderstanding the manual. My template is a valid XML document (with closing tags), but I think it is possible that the coding in your user's guide is what I need to do. If I could see a working template I think that I can figure the rest out.

Thanks!
0 votes

Hi,

if you install knowage through the installer (available at http://forge.ow2.org/project/showfiles.php?group_id=442&release_id=5958), you'll be able to run demo documents.

Anyway I attach you an example of svg (USA map):

https://www.knowage-suite.com/qa/?qa=blob&qa_blobid=10014262765221966026

Regards.

by (4.4k points)
I have an SVG map file. I need to see an XML document that defines the template. One that contains things like this:

<?xml version="1.0" encoding="UTF-8"?>
<MAP>
 <DATAMART_PROVIDER>
    <HIERARCHY name="USA">
       <MEMBER name ="regions" measure_dataset = "ds_regions" level="1" />
       <MEMBER name ="states" measure_dataset = "ds_states" level="2" />
    </HIERARCHY>
 </DATAMART_PROVIDER>
</MAP>
Here the demo template (obviously you have to define the dataset correctly):

<?xml version="1.0" encoding="UTF-8"?>
<MAP>

    <DATAMART_PROVIDER>
      <HIERARCHY name="USA">
        <MEMBER name = "regions" measure_dataset = "DS_REGIONS_SVG" level="1">  
          <METADATA>
               <COLUMN type="geoid"   column_id="sales_region" />      
               <COLUMN type="measure" column_id="store_sales"/>
               <COLUMN type="measure" column_id="store_cost"/>
               <COLUMN type="measure" column_id="unit_sales"/>
               <!--<COLUMN type="drillid" column_id="member_name" />    -->
               <COLUMN type="info" column_id="info_text" />                   
          </METADATA>    
          <LAYERS>
            <LAYER name="regions" description="Regions" selected="true" />
            <LAYER name="Labels_Region_Names" description="Labels Region Names" selected="false" />
            <LAYER name="Country_borders" description="Country Borders" selected="false" />
          </LAYERS>  
          <MEASURES default_kpi="unit_sales">
           <KPI column_id="store_sales" description="Store Sales" >
              <TRESHOLDS type="quantile" lb_value="0" ub_value="none" >
                <PARAM name="GROUPS_NUMBER" value="5" />
              </TRESHOLDS>
              <COLOURS type="grad" outbound_colour="#FFFFFF" null_values_color="#CCCCCC" >
                <PARAM name="BASE_COLOR" value="#009900" />
              </COLOURS>
            </KPI>
            
            <KPI column_id="store_cost" description="Store Cost" >
              <TRESHOLDS type="quantile" lb_value="0" ub_value="none" >
                <PARAM name="GROUPS_NUMBER" value="5" />
              </TRESHOLDS>
              <COLOURS type="grad" outbound_colour="#FFFFFF" null_values_color="#CCCCCC" >
                <PARAM name="BASE_COLOR" value="#3333CC" />
              </COLOURS>
            </KPI>
            <KPI column_id="unit_sales" description="Unit Sales" >
              <TRESHOLDS type="quantile" lb_value="0" ub_value="none" >
                <PARAM name="GROUPS_NUMBER" value="5" />
              </TRESHOLDS>
              <COLOURS type="grad" outbound_colour="#FFFFFF" null_values_color="#CCCCCC" >
                <PARAM name="BASE_COLOR" value="#9900FF" />
                <!--<PARAM name="opacity" value="0.8" />-->
              </COLOURS>
            </KPI>
           </MEASURES>          
       </MEMBER>                   
      </HIERARCHY>
    </DATAMART_PROVIDER>                       
</MAP>
Unfortunately I still cannot get this to work. I have created the SVG catalog entry using your file. I have defined a dataset called claim_state_data. I have created a template file called knowage_map.xml. It is directly based on the template that you sent me. Here it is:

<?xml version="1.0" encoding="UTF-8"?>
<MAP>
   <DATAMART_PROVIDER>
      <HIERARCHY name="USA">
        <MEMBER name = "regions" measure_dataset = "claim_state_data" level="1">  
          <METADATA>
               <COLUMN type="geoid"   column_id="facility_state" />      
               <COLUMN type="measure" column_id="total_claim_amount"/>
               <COLUMN type="measure" column_id="num_claims"/>
          </METADATA>    
          <LAYERS>
            <LAYER name="regions" description="Regions" selected="true" />
            <LAYER name="Labels_Region_Names" description="Labels Region Names" selected="false" />
        <LAYER name="Country_borders" description="Country Borders" selected="false" />
        <LAYER name="states" description="US States" selected="false" />
          </LAYERS>  
          <MEASURES default_kpi="total_claim_amount">
           <KPI column_id="total_claim_amount" description="Claim Charges" >
              <THRESHOLDS type="quantile" lb_value="0" ub_value="none" >
                <PARAM name="GROUPS_NUMBER" value="5" />
              </THRESHOLDS>
              <COLOURS type="grad" outbound_colour="#FFFFFF" null_values_color="#CCCCCC" >
                <PARAM name="BASE_COLOR" value="#009900" />
              </COLOURS>
            </KPI>            
            <KPI column_id="num_claims" description="Number of Claims" >
              <THRESHOLDS type="quantile" lb_value="0" ub_value="none" >
                <PARAM name="GROUPS_NUMBER" value="5" />
              </THRESHOLDS>
              <COLOURS type="grad" outbound_colour="#FFFFFF" null_values_color="#CCCCCC" >
                <PARAM name="BASE_COLOR" value="#3333CC" />
              </COLOURS>
            </KPI>
           </MEASURES>          
         </MEMBER>                   
       </HIERARCHY>
   </DATAMART_PROVIDER>                       
</MAP>
I am able to save the document as specified in the user guide. When I execute this document, I get this message:

An error occurred while inserting relation between document and its datasets. Please check the document template and the existance of the datasets.

The dataset exists. I can query it and display it in Knowage. I have verified that the column names are correct. What am I doing wrong?????
I've tried everything I can think of. I have simplified the SVG file. I have added member_name and set its value to "states" in the dataset. I still get the same error. Does this actually work in CE?
Hi,
   that error occours when the system doesn't able to insert a relation between the document and its datasets.

So, please:
- check the engine are you using into the document template..it must be SvgViewerEngine.
- check hierarchy's information, they must be coerent with the catalog definition (don't set member name if they aren't correctly defined)
- check server logs file..maybe there are some useful suggestion...

However, remember that it's key-sensitive... so all labels must be coerent.
...