Re: [Libosmscout-development] add feature to address type
Library for OpenStreetMap offline rendering and routing
Status: Beta
Brought to you by:
tteuling
|
From: Stephan L. <st...@ar...> - 2016-09-09 10:46:27
|
Hi,
i also haven't given up on creating a new Type POSTCODE and a
PostcodeFeature/PostcodeFeatureValue.
so i can have :
TYPE postcode
= NODE AREA (EXISTS "addr:postcode")
POSTCODE
So postcode is in group location same as address.
so far i have copied all address related stuff and made it for postcode.
it is quite alot and overview is hard if not to say impossible to track
what is needed.
As is said i have a PostcodeFeature/Value/Reader and a type in
typeconfig for the postcode.
Also i have extended the Place to get Postcode.
I have also extended the GenAreaArea and GenLocationIndex for the import.
I am nor sure how this :
scanner.Read(location);
scanner.Read(address);
scanner.Read(postcode);
can know how to find a postcode or address in GenLocationIndex.cpp???
I guess the actual "Data" of an address is stored in areaaddress.dat and
nodeaddress.dat???
My goal was to have a location with postcode even if the location has no
"address" which is actual a housenumber.
But the actual location indexes are stored all together in location.idx?
So i need a new lets say "AREAPOSTCODE_DAT" and "NODEPOSTCODE_DAT"
for the postcode data in the GenAreaAreaIndex and GenLocationIndex??
I was able to build the whole lib and import a map , but when i try to
get a "Place" it says : "Position beyond file end"
So i guess something is messed up with the locationindexes?!
AreaLocationProcessorFilter::Process(....
...
NameFeatureValue
*nameValue=nameReader->GetValue(ring->GetFeatureValueBuffer());
LocationFeatureValue
*locationValue=locationReader->GetValue(ring->GetFeatureValueBuffer());
AddressFeatureValue
*addressValue=addressReader->GetValue(ring->GetFeatureValueBuffer());
PostcodeFeatureValue
*postcodeValue=postcodeReader->GetValue(ring->GetFeatureValueBuffer());
std::string name;
std::string location;
std::string address;
std::string postcode;
if (nameValue!=NULL) {
name=nameValue->GetName();
}
if (locationValue!=NULL) {
location=locationValue->GetLocation();
}
if (addressValue!=NULL) {
address=addressValue->GetAddress(); <<<<<<<<< CALLED.
}
if(postcodeValue!=NULL) {
postcode=postcodeValue->GetPostcode();
std::cout << "AreaLocationProcessorFilter::Process ->
PostcodeFeatureValue = " + postcode; <<<<<<<<< NOT CALLED.
}
bool isAddress=!ring->GetType()->GetIgnore() &&
!location.empty() &&
!address.empty();
bool isPostcode=!ring->GetType()->GetIgnore() &&
!location.empty() &&
!postcode.empty();
bool isPoi=!name.empty() && ring->GetType()->GetIndexAsPOI();
size_t locationIndex;
if (locationReader->GetIndex(ring->GetFeatureValueBuffer(),
locationIndex) &&
ring->GetFeatureValueBuffer().HasFeature(locationIndex)) {
ring->UnsetFeature(locationIndex);
}
if (!isAddress && !isPostcode && !isPoi) {
continue;
}
if (ring->IsMasterRing() &&
ring->nodes.empty()) {
for (std::vector<Area::Ring>::const_iterator
r=area.rings.begin();
r!=area.rings.end();
++r) {
if (r->IsOuterRing()) {
writer.WriteFileOffset(offset);
writer.WriteNumber(ring->GetType()->GetAreaId());
writer.Write(name);
writer.Write(location);
writer.Write(address);
writer.Write(postcode);
writer.Write(r->nodes,false);
overallDataCount++;
}
}
What is the actual difference between a type and a feature??
Do i really need a type or can't i just use a new feature to be able to get
place.GetPostcode() beside with place.GetAddress() ???
Thanks
Regards,
Stephan.
Am 08.09.2016 um 21:59 schrieb Tim Teulings:
> Hello Adrian,
>
>> i give up for today, this library is very frustrating i still dont have
>> the feeling i know what im doing.
> If concepts are unclear, please ask.
>
>> I thought today ill try to make the addr:postcode visible in the
>> locations but as you can see by my recent mails ive not come very far.
>>
>> I dont know when ive time to work on this again, since i actually need
>> to get some other stuff done after 2 resultless days :)
> That is sad to hear. Please use the time to ask and let me give some
> answers, so if you came back to your current code you are better
> prepared.
--
Mit freundlichen Grüßen
Stephan Lehmann
-----------------------------------------------------------------
A.R.T.E.C.O. GmbH Am Heidekrug 36-37,
16727 Velten +49 3304 2020-171 | in...@ar... | https://arteco.de
HRB 11171 NP beim AG Neuruppin | USt-ID: DE813076864
Geschäftsführer: Torsten Göhring & Wolf-Peter Sachse
-----------------------------------------------------------------
|