Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加自定义地址失败 #4

Closed
DarkPet opened this issue Mar 4, 2023 · 4 comments
Closed

添加自定义地址失败 #4

DarkPet opened this issue Mar 4, 2023 · 4 comments

Comments

@DarkPet
Copy link

DarkPet commented Mar 4, 2023

添加自定义地址失败,geocoding.addRegionEntry(1, 321200000000, "A街道", geocoding.RegionType.Street) 总是返回 False
无法得到想要的结果
Address(
provinceId=320000000000, province=江苏省,
cityId=321200000000, city=泰州市,
districtId=None, district=None,
streetId=None, street=None,
townId=None, town=None,
villageId=None, village=None,
road=None,
roadNum=None,
buildingNum=None,
text=A街道
)

@fjklqq
Copy link
Owner

fjklqq commented Mar 4, 2023

是的,昨天Debug了一下,发现在JVM执行GeocodingX.addRegionEntry方法时,会出现找不到匹配的重载的问题。

TypeError: No matching overloads found for org.bitlap.geocoding.GeocodingX.addRegionEntry(), options are:
	public final org.bitlap.geocoding.GeocodingX org.bitlap.geocoding.GeocodingX.addRegionEntry(long,long,java.lang.String,org.bitlap.geocoding.model.RegionType,java.lang.String,boolean)

看了一下项目源码,参数类型应该是匹配的,所以还没有解决方案(主要是Java代码的能力我仅限于读一读了解个大概)

后面再看一下具体是什么原因导致的。

目前可以先安装上一个版本来使用自定义地址功能

@DarkPet
Copy link
Author

DarkPet commented Mar 5, 2023

找到问题了
try:
self.geocoding.addRegionEntry(id=Id, parentId=parentId, name=name,
RegionType=RegionType, alias=alias, replace=replace)
return True
except:
return False
修改为:
try:
self.geocoding.addRegionEntry(Id, parentId, name, RegionType, alias, replace)
return True
except:
return False

@fjklqq
Copy link
Owner

fjklqq commented Mar 5, 2023

找到问题了

    try:

        self.geocoding.addRegionEntry(id=Id, parentId=parentId, name=name,

                                      RegionType=RegionType, alias=alias, replace=replace)

        return True

    except:

        return False

修改为:

    try:

        self.geocoding.addRegionEntry(Id, parentId, name, RegionType, alias, replace)

        return True

    except:

        return False

好的,今晚测试一下,顺便更新一下jar包。

@DarkPet
Copy link
Author

DarkPet commented Mar 5, 2023

@casuallyName

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants