QGIS: Full list of data in Display/Maptips? - qgis

I’m new to GIS and QGIS. I’ve successfully joined 3 tables of data: Addresses, Persons and Polygons. The polygons represent the address on the map, and each address “contains” the names of all people on that address:
I want to use Display/Map tips to show a list of all people on every address when hovering over the polygon corresponding to the address. I’ve done this by pasting [% "Person_Name” %] in the Display tab of the properties.
However, I cannot figure out how to print a full list of names. Only one name on the list appears:
Is there a solution to print a full list of names when hovering over the address/polygon?
All help is much appreciated!
I tried the built-in syntax [% "x” %]

Related

power bi filled maps wont plot for the state of UT

I am having an issue getting the filled map visual to work.
Would appreciate any pointers to correct this issue.
I am trying to create a filled map visual to show:
a) Count of Providers in the State (this count also controls the
color saturation on the map)
b) Count of Networks in the State
The data is setup like this:
The map fills correctly, except for the state of Utah,
If I create a "Table" visual with the same data,
the counts for Utah show up correctly (so I know it is not a data or calculation issue).
I have set the "State" field in Power BI Modeling to a Data Category of "State or Province"
I have tested the following as part of my troubleshooting:
1) Replacing all the state abbreviations with fully spelled state names
(eg replace "UT" with "Utah", and it still will not plot)
2) If I change the Map configuration to use Zipcodes instead of the State, the map will plot the zip codes correctly for the state of UT.
Screen shot of the map with UTAH not filled in, and the data used to fill the map....
I have a kludgy solution to this problem.
It involves creating a new column in the table with the following formula:
US_States = IF('TableName'[AddressState]="LA","Louisiana,USA",'TableName'[AddressState]&",USA").
What this does is add a ",USA" suffix to each state abbreviation, and if the state="LA", spell out the state to "Louisiana, USA"- this is because Bing maps would otherwise plot LA as "Los Angeles" (good grief!).
You must set the new column of "US_States to a data category of "Place"
Hope someone else can benefit from this post. –

Excel Data entry forms in VBA

I am very new to VBA and have been searching to try to figure this out but with no luck.
I am trying to make a form that pops up and has a bunch of different fields to enter and then when the form is submitted, the information is input into separate, specific cells. Also, once the information is input into the cells, it needs to be printed for our records. One last thing to add is that I need some of the fields to disappear if they are empty on the form so that they do not print.
I have a lot of fields for this and all that I have found is how to insert into a new row. If this can be done it would help me out a LOT. If anyone can point me in the right direction then I may be able to figure some out on my own I am fairly literate in HTML so I am able to do some coding.
The fields I have to enter:
Deposited By:
Number of Deposits:
Total Checks:
Electronic Deposit Number:
Electronic Deposit Number:
Manual Deposit Number:
Deposit Amount:
Deposit Amount:
Deposit Amount:
Houston Depos:
Dallas Depos:
Austin Depos:
Houston Video:
Dallas Video:
Austin Video:
Houston Records:
I will also need to add a button or make the form popup whenever the spreadsheet is opened so that the information can be entered but I believe that may be a little easier to figure out. Along with pre-filling the form with the information already on the page so that it can be edited.
I'll try to answer a few of your questions that you had so hopefully you can write some of your own code:
Form popup whenever the spreadsheet is opened (Placed in the ThisWorkbook code):
Private Sub Workbook_Open()
UserForm1.Show
End Sub
You can also add a button in the Worksheet and assign it a macro which uses UserForm1.Show.
For the pre-filling the form with information from the sheet use commands like this (Placed in your UserForm code:
Private Sub UserForm_Initialize()
txtDepositedBy.Text = Sheets("Sheet1").Range("A2")
End Sub
To print your sheets use the Sheets.PrintOut Method:
ActiveSheet.PrintOut
'or
Sheets("Sheet3").PrintOut
It has these inputs:
.PrintOut(From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, IgnorePrintAreas)
To take your inputs from text boxes and other elements, you can use commands like these:
ActiveSheet.Range("A1").Value = TextBox1.Text
'or
Sheets("Sheet3").Range("B2").Value = ComboBox1.Text
This should cover a lot of your questions. If you have anymore just let me know and I'll add to the post.

Remove street numbers from OSM maps

I'm still working on my map project. I use mapnik tools to render my own maps.
Mapnik reads a xml file to style each tiles.
At this moment, i managed to remove street names and all stuff that was useless for my project. The only problem i have is about removing the street numbers, which still appear even when all useless layers are off.
I give you a pastebin link to my xml file: http://pastebin.com/ZRtmYBRz.
Do you know how i can remove the street numbers ? Thanks.
Before :
Now:
Try using a filter on the addr:housenumber tag of the nodes in the source file that contain that info. Once you get those, you can change the rendering by using a TextSymbolizer.
More info on https://github.com/mapnik/mapnik/wiki/TextSymbolizer

Call to Subroutine from Catalyst Controller

I am working on catalyst to design a front end for a database. I am new to perl and catalyst. I am stuck with one error in the controller.
I want to fetch gene names from one table and pass each gene name to a subroutine gene_name(call a subroutine gene_name) which will perform certain function. I some how fetched the column with gene names but they are in the form of Hash reference to other table. My call to gene_name is not working.
Any idea how to pass the values to the subroutine rather than reference?
My code is as follows:
my #gene_list = $c->model('Gene::GeneTable')->search({
},{
column =>[qw/symbol/],
}
);
foreach my $gene (#gene_list){
push #gene_aliases, &gene_name($gene);
}
The error I am getting after executing the code is as follows:
DBIx::Class::ResultSet::find(): Can't bind a reference (MyApp::Model::Gene::GeneTable=HASH(0x7ff6d88b7c58))
UPDATED
My gene_name() subroutine is in another module which I have included in the controller. Now I have changed the for loop(in controller) as following and currently it is passing gene name to gene_name() to fetch aliases(But query remains the same):
foreach my $gene (#gene_list){
push #gene_aliases, &gene_name($gene-> symbol);
}
I am accessing the #gene_aliases in my view file as follows:
[% FOREACH g in gene_aliases -%]
[% g %]
[% END -%]
The above code is fetching hash references instead of names in the page. I am not able to display the gene names on web page.If I give [% g.symbol %] in for loop then the page would be empty with no error message.Hope this would be sufficient information for answering my question. If not I would elaborate on it.
My SQL query is as follows:
Select Symbol from GeneTable;
Thanks in advance
UPDATED2
As I am not a full time programmer, I am asking these questions on the blog. Kindly help me resolve my issues. If in case I have search form which takes gene name from user and this gene name has to be passed to the gene_name() subroutine, how do I pass this (to the controller and how to call the gene_name()). Kindly help me in resolving this issue.
My form in view.tt is as follows:
<form method="post" action "[% c.uri_for('/gene')%]">
<input type="text" name="search_alias">
<input type="submit" name="alias_search" value="Search">
</form>
All my aliases are in the other table called Alias, which is been used in gene_name() subroutine.
Either the gene_name() function needs to expect a GeneTable object being passed to it, or you would call it like this: gene_name($gene->symbol).
Having said that, the Controller does not look like the right place for this, based on what limited information you've provided.
It would make a lot more sense to have gene_name as a method of Gene::GeneTable itself, ie:
package GeneTable;
...
sub gene_name {
my $self = shift;
my $gene_name = ... # do something with $self->symbol
$gene_name
}
...
So that the ->gene_name method is available to any GeneTable object in any context.
UPDATE following OP's initial two comments
It sounds like gene_name() (which possibly should be called gene_aliases()) is a method of a Gene object. Putting such a conversion into a Controller does not adhere to good MVC philosophy.
Presumably you have model code somewhere - MyApp/Model/Gene/ most likely - and this sub should exist inside Gene/GeneTable.pm. Then you could use it thus:
[%- FOREACH g IN gene_list -%]
[% g.symbol %]<br/><ul>
[%- FOREACH gn IN g.gene_name -%]
<li>[% gn %]</li>
[%- END -%]
</ul>
[%- END -%]
in your template, and anywhere else you have a GeneTable object or collection thereof.
UPDATE #2 Following updated question
DBIx:Class will return an array of objects when called in list context as you do. Perhaps you need to add some Data::Dumper->Dumper() calls to get a handle on what each step is returning to you.
I suggest you add the following line immediately after your call to ->search():
$c->log->debug("gene_list contains: ", Data::Dumper->Dumper(\#gene_list));
...and possibly the equivalent debug for #gene_aliases after you've populated that.
That might give you a clearer picture of what you're getting back from your search, but I'd hazard a guess you're getting Gene::GeneTable objects.

Access 2013 - Embedded query filtered by combo box on form

I'm new to Access and this is the problem I'm suffering: I have four tables - Task, Person, Role, and TaskPerson (mapping table). I have a form that at the top has a unbound combo box displaying a list of people from Person. In the body of the form I have a query pulling from the Task and TaskPerson tables that is embedded as a datasheet. The fields from TaskPerson perform a lookup on Person and Role to display the actual values. Each task can have multiple people assigned to it and each person can have multiple roles. I am looking to pick a name from the combo box with the datasheet updating to only show the tasks associated with that person (i.e. matching the name from the combo box to the name in the person field (which is a lookup) on the form and only showing those tasks).
I have tried adjusting the Record Source for the query so the person field criteria would pull from the combo box using
'Forms![Task Form]![Combo11]'
but that hasn't worked. I have also tried a version of this answer:
Private Sub Form_SelectionChange()
' If the combo box is cleared, clear the form filter.
If Nz(Form) = "" Then
Me.Form.Filter = ""
Me.FilterOn = False
' If a combo box item is selected, filter for an exact match.
' Use the ListIndex property to check if the value is an item in the list.
ElseIf Me.Combo11.ListIndex <> -1 Then
Me.Form.Filter = "[Combo11] = '" & _
Replace(Me.Combo11.Text, "'", "''") & "'"
Me.FilterOn = True
End If
End Sub
While the code is not balking, it also isn't grabbing the selected name from the combo box, so it doesn't update. A likely factor is when I type Me.Combo11.Text, it doesn't actually display Combo11 as an option. I tried typing it in, in hopes of working, but I know that is a bit foolish.
Any detailed answers would be appreciated. I'm still learning my way around and I get lost a bit easily.
Steve.
The first method is the easier one.
In the query you have
WHERE TaskPerson = Forms![Task Form]![Combo11]
Note that there are no ' around the combo reference. With 'Forms![Task Form]![Combo11]' the whole thing is interpreted as string, so it doesn't work.
Then in Combo11_AfterUpdate you simply have
Me.Requery
Disadvantage of this method: you always have to select a person, or the form will be empty.
The second method:
Your query lists all record, the combobox applies a filter. Or removes it, if the user clears the combobox.
I suggest going back to the answer you used, and only replace
Combo_Reported_LOB_Selection by Combo11
and
[ReportedLOB] by [TaskPerson]
And the code doesn't go into Form_SelectionChange(), but into Combo11_AfterUpdate()